I’m using inline formulas to create some dynamic text content. For ease of editing and access, I’d hoped to pull the text from a single-row table, so my formulas stay readable. However, whenever I try this, the inline formula forgets how to do line wrapping, and the text just runs off the right side of the page.
The issue goes away if I paste the text directly into the formula.
@Sam_Stowers, would you mind sharing the formula that caused the text to run off the page?
If adding ToText() helped, I’m guessing that the formula was returning a full row of a table or an array of multiple rows even if there was only one row.
Formula below. Not sure how to format it nicely, so will also include a screenshot for readability.
SwitchIf([General User Data].[Sleep Efficiency Average Last 7 Days]<0.84,[Treatment Content].[Titration Reduce],[General User Data].[Sleep Efficiency Average Last 7 Days]>=0.84 AND [General User Data].[Sleep Efficiency Average Last 7 Days]<0.90, [Treatment Content].[Titration Maintain], [Treatment Content].[Titration Increase])
I think the preview text turns blue when Coda is returning a row instead of a specific value (of course, you’d know for sure). Hence why this seems to be a cell value and not a row. Also relevant: the table in question (Treatment Content) only has one row in it.
If it’s better form to change the shape of the table to use rows instead of columns, I can do that?
I’m so happy you shared a screenshot as well! There’s a subtle clue in there showing the issue you were running into. The “T” icon for the value that’s returned isn’t a single square, it’s a stacked icon. This means that it’s returning any rows that match the statement. So even if it’s only one row, it’s still returning as an array.
ToText() forces this to a text value or you could add .First() after each item to only pull in the first row in the formula.