Removing Extra Spacing/Lines

Hello Text Blaze team,

I am trying to remove blank lines from the snippet below. I found this post which was very helpful: Remove whitespace but keep space between fields in preview - #8 by Dylan. I applied it to my snippet, but now the vitamin D and ferritin blurbs have no spacing for "Findings to work on" "Focus Area" and "Goal (AI)."

{note}
{formtext: name=TMAO1}
{formtext: name=VitD1}
{formtext: name=Homocysteine1}
{formtext: name=Ferritin1}

{if: tmao1>7.9}{`TMAO Status`="High TMAO"}{elseif: tmao1<=7.9}{`TMAO Status`="Normal TMAO"}{endif}
{if: VitD1<30}{`VitD Status`="Low VitD"}{elseif: VitD1<40}{VitD Status="Borderline VitD"}{elseif: VitD1>=40}{`VitD Status`="Normal VitD"}{endif}
{if: homocysteine1>14}{`Homocysteine Status`="High Homocysteine"}{elseif: homocysteine1>=10}{`Homocysteine Status`="Borderline Homocysteine"}{elseif: homocysteine1<10}{`Homocysteine Status`="Normal Homocysteine"}{endif}
{if: ferritin1<15}{`Ferritin Status`="Low Ferritin"}{elseif: ferritin1>=15}{`Ferritin Status`="Normal Ferritin"}{endif}

Key Findings
Favorable Findings{endnote}{key: tab}{key: enter}{key: uparrow}
{note}Findings to work on
{endnote}{if: `TMAO Status`== "High TMAO"}Elevated TMAO
{endif}{if: `VitD Status`== "Low VitD"}Low Vitamin D{elseif: `VitD Status`== "Borderline VitD"}Slightly Low Vitamin D
{endif}{if: `Homocysteine Status`== "Borderline Homocysteine"}Mildly Elevated Homocysteine{elseif: `Homocysteine Status`=="High Homocysteine"}Elevated Homocysteine
{endif}{if: `ferritin status`== "Low Ferritin"}Low Ferritin{endif}{key: tab}{key: enter}{key: uparrow}{note}

Goals (KF){endnote}
{if: `TMAO Status`== "High TMAO"}Decrease TMAO
{endif}{if: `VitD Status`== "Low VitD" or `VitD Status`== "Borderline VitD"}Improve Vitamin D
{endif}{if: `Homocysteine Status`== "Borderline Homocysteine" or `Homocysteine Status`== "High Homocysteine" }Decrease Homocysteine
{endif}{if: `ferritin status`== "Low Ferritin"}Improve Ferritin{endif}{key: tab}{key: enter}{key: uparrow}{note}

Action Items
Focus Area{endnote}
{if: `TMAO Status`== "High TMAO"}Elevated TMAO
{endif}{if: `VitD Status`== "Low VitD"}Low Vitamin D{elseif: `VitD Status`== "Borderline VitD"}Slightly Low Vitamin D
{endif}{if: `Homocysteine Status`== "Borderline Homocysteine"}Mildly Elevated Homocysteine{elseif: `Homocysteine Status`=="High Homocysteine"}Elevated Homocysteine
{endif}{if: `ferritin status`== "Low Ferritin"}Low Ferritin{endif}{key: tab}{key: enter}{key: uparrow}{note}
Goal (AI){endnote}
{if: `TMAO Status`== "High TMAO"}TMAO (Target<7.9 umol/L)
{endif}{if: `VitD Status`== "Low VitD"}Improve Vitamin D (Target: 40 - 60 ng/mL){elseif: `VitD Status`== "Borderline VitD"}Improve Vitamin D (Target: 40 - 60 ng/mL)
{endif}{if: `Homocysteine Status`== "Borderline Homocysteine" or `Homocysteine Status`== "High Homocysteine" }Homocysteine (Target: < 10.0 umol/L)
{endif}{if: `ferritin status`== "Low Ferritin"}Ferritin (Target: > 15 ng/mL){endif}{key: tab}{key: enter}{key: uparrow}{note}
Next Steps{endnote}

Thanks again for the help!

Best,
Abby

Hey Abby,

Happy to help.

If I understand correctly, you want the "Findings to work on" "Focus Area" and "Goal (AI)" fields to have space between them. Does the snippet below do what you're asking? If not, let me know what you're trying to do and I can take another stab at it :slight_smile:

{note}
{formtext: name=TMAO1}
{formtext: name=VitD1}
{formtext: name=Homocysteine1}
{formtext: name=Ferritin1}

{if: tmao1>7.9}{TMAO Status="High TMAO"}{elseif: tmao1<=7.9}{TMAO Status="Normal TMAO"}{endif}
{if: VitD1<30}{VitD Status="Low VitD"}{elseif: VitD1<40}{VitD Status="Borderline VitD"}{elseif: VitD1>=40}{VitD Status="Normal VitD"}{endif}
{if: homocysteine1>14}{Homocysteine Status="High Homocysteine"}{elseif: homocysteine1>=10}{Homocysteine Status="Borderline Homocysteine"}{elseif: homocysteine1<10}{Homocysteine Status="Normal Homocysteine"}{endif}
{if: ferritin1<15}{Ferritin Status="Low Ferritin"}{elseif: ferritin1>=15}{Ferritin Status="Normal Ferritin"}{endif}

Key Findings
Favorable Findings{endnote}{key: tab}{key: enter}{key: uparrow}

{note}Findings to work on
{endnote}{if: `TMAO Status`== "High TMAO"}Elevated TMAO
{endif}{if: `VitD Status`== "Low VitD"}Low Vitamin D{elseif: `VitD Status`== "Borderline VitD"}Slightly Low Vitamin D
{endif}{if: `Homocysteine Status`== "Borderline Homocysteine"}Mildly Elevated Homocysteine{elseif: `Homocysteine Status`=="High Homocysteine"}Elevated Homocysteine
{endif}{if: `ferritin status`== "Low Ferritin"}Low Ferritin{endif}{key: tab}{key: enter}{key: uparrow}{note}

Goals (KF){endnote}
{if: `TMAO Status`== "High TMAO"}Decrease TMAO
{endif}{if: `VitD Status`== "Low VitD" or `VitD Status`== "Borderline VitD"}Improve Vitamin D
{endif}{if: `Homocysteine Status`== "Borderline Homocysteine" or `Homocysteine Status`== "High Homocysteine" }Decrease Homocysteine
{endif}{if: `ferritin status`== "Low Ferritin"}Improve Ferritin{endif}{key: tab}{key: enter}{key: uparrow}{note}

Action Items

Focus Area{endnote}
{if: `TMAO Status`== "High TMAO"}Elevated TMAO
{endif}{if: `VitD Status`== "Low VitD"}Low Vitamin D{elseif: `VitD Status`== "Borderline VitD"}Slightly Low Vitamin D
{endif}{if: `Homocysteine Status`== "Borderline Homocysteine"}Mildly Elevated Homocysteine{elseif: `Homocysteine Status`=="High Homocysteine"}Elevated Homocysteine
{endif}{if: `ferritin status`== "Low Ferritin"}Low Ferritin{endif}{key: tab}{key: enter}{key: uparrow}{note}

Goal (AI){endnote}
{if: `TMAO Status`== "High TMAO"}TMAO (Target<7.9 umol/L)
{endif}{if: `VitD Status`== "Low VitD"}Improve Vitamin D (Target: 40 - 60 ng/mL){elseif: `VitD Status`== "Borderline VitD"}Improve Vitamin D (Target: 40 - 60 ng/mL)
{endif}{if: `Homocysteine Status`== "Borderline Homocysteine" or `Homocysteine Status`== "High Homocysteine" }Homocysteine (Target: < 10.0 umol/L)
{endif}{if: `ferritin status`== "Low Ferritin"}Ferritin (Target: > 15 ng/mL){endif}{key: tab}{key: enter}{key: uparrow}{note}
Next Steps{endnote}

Hi Brian,

This is close, but what I'm really hoping to do is conditionally populate "Key Findings" and "Action Items" based on defined statuses defined in the formula located in the note of the snippet. The headers each represent a cell in a google sheet (ie: Favorable Findings, Findings to Work on, Goals (KF), Focus Area, Goals (AI), and Next Steps) that I hope to populate.

For example: If TMAO Status== "High TMAO" and VitD Status=="Low VitD"" Populate:
Favorable Findings:
Nothing

Findings to work on:
Elevated TMAO
Low Vitamin D

Goals (KF):
Decrease TMAO
Increase Vitamin D
etc....

Right now the VitD and TMAO blurbs are all on one line (see image)


They should all look like Goals (KF).

Hey Abby,

I think I was able to get this to do what you wanted, try this version and let me know if there's any trouble with it.

The only thing that I changed was to put a return (enter) before each of your {elseif} tags in the Goal (AI) and Focus Area sections.

{note}
{formtext: name=TMAO1}
{formtext: name=VitD1}
{formtext: name=Homocysteine1}
{formtext: name=Ferritin1}

{if: tmao1>7.9}{`TMAO Status`="High TMAO"}{elseif: tmao1<=7.9}{`TMAO Status`="Normal TMAO"}{endif}
{if: VitD1<30}{`VitD Status`="Low VitD"}{elseif: VitD1<40}{`VitD Status`="Borderline VitD"}{elseif: VitD1>=40}{`VitD Status`="Normal VitD"}{endif}
{if: homocysteine1>14}{`Homocysteine Status`="High Homocysteine"}{elseif: homocysteine1>=10}{`Homocysteine Status`="Borderline Homocysteine"}{elseif: homocysteine1<10}{`Homocysteine Status`="Normal Homocysteine"}{endif}
{if: ferritin1<15}{`Ferritin Status`="Low Ferritin"}{elseif: ferritin1>=15}{`Ferritin Status`="Normal Ferritin"}{endif}

Key Findings
Favorable Findings{endnote}{key: tab}{key: enter}{key: uparrow}

{note}Findings to work on
{endnote}{if: `TMAO Status`== "High TMAO"}Elevated TMAO
{endif}{if: `VitD Status`== "Low VitD"}Low Vitamin D
{elseif: `VitD Status`== "Borderline VitD"}Slightly Low Vitamin D
{endif}{if: `Homocysteine Status`== "Borderline Homocysteine"}Mildly Elevated Homocysteine
{elseif: `Homocysteine Status`=="High Homocysteine"}Elevated Homocysteine
{endif}{if: `ferritin status`== "Low Ferritin"}Low Ferritin{endif}{key: tab}{key: enter}{key: uparrow}{note}

Goals (KF){endnote}
{if: `TMAO Status`== "High TMAO"}Decrease TMAO
{endif}{if: `VitD Status`== "Low VitD" or `VitD Status`== "Borderline VitD"}Improve Vitamin D
{endif}{if: `Homocysteine Status`== "Borderline Homocysteine" or `Homocysteine Status`== "High Homocysteine" }Decrease Homocysteine
{endif}{if: `ferritin status`== "Low Ferritin"}Improve Ferritin{endif}{key: tab}{key: enter}{key: uparrow}{note}

Action Items

Focus Area{endnote}
{if: `TMAO Status`== "High TMAO"}Elevated TMAO
{endif}{if: `VitD Status`== "Low VitD"}Low Vitamin D
{elseif: `VitD Status`== "Borderline VitD"}Slightly Low Vitamin D
{endif}{if: `Homocysteine Status`== "Borderline Homocysteine"}Mildly Elevated Homocysteine
{elseif: `Homocysteine Status`=="High Homocysteine"}Elevated Homocysteine
{endif}{if: `ferritin status`== "Low Ferritin"}Low Ferritin{endif}{key: tab}{key: enter}{key: uparrow}{note}

Goal (AI){endnote}
{if: `TMAO Status`== "High TMAO"}TMAO (Target<7.9 umol/L)
{endif}{if: `VitD Status`== "Low VitD"}Improve Vitamin D (Target: 40 - 60 ng/mL)
{elseif: `VitD Status`== "Borderline VitD"}Improve Vitamin D (Target: 40 - 60 ng/mL)
{endif}{if: `Homocysteine Status`== "Borderline Homocysteine" or `Homocysteine Status`== "High Homocysteine" }Homocysteine (Target: < 10.0 umol/L)
{endif}{if: `ferritin status`== "Low Ferritin"}Ferritin (Target: > 15 ng/mL){endif}{key: tab}{key: enter}{key: uparrow}{note}
Next Steps{endnote}

1 Like

Hi Andrew,

This is perfect! I'm now trying to further improve this snippet with Data Blaze, but I've run into a problem. When I try to call row 1 from my table, it is populating data from row 20:

My table:

The function:
Screen Shot 2023-05-19 at 9.23.49 AM

The output:

Any ideas on what might be going on here?

Thanks again for all your help!

@Abby_Buccino your {dbselect} command is set to menu=no and multiple=yes. As a result, you're not being presented with a dropdown menu to select the right value, and it's selecting everything in your table that matches the conditions of your {dbselect} command. Those commands have no conditions by default, so it's probably just selecting the entire table.

Try changing your {dbselect} command to menu=yes and multiple=no. You may also need to remove the "name" setting, depending on what your planned use is.

Data Blaze has potential to be tricky the first time you use it. If you want to review this live, reach out to me andrew@blaze.today -- we could probably knock this out in 10 or 15 minutes.

1 Like