Removing whitespace from text generated by a formula

I have been using formulas to conditionally show titles in my dashboards but for some reason the text gets a small space added to it before the text starts (See example). I don’t have a space in the formula so wondering what I can do to bring the formula driven title inline with another title?

Its a small thing but I really do love UI that is consistent and clean:

2 Likes

Trim()

Should remove whitespace for you where needed!

2 Likes

I’m not sure Trim() will work here :thinking:

Canvas formulas return some whitespace before and after their values (for some reasons :woman_shrugging: ) …
At least, I’ve seen this a lot …

The value returned by the canvas formula in the screenshot below has been selected to highlight the whole space it takes vs. where the next line starts effectively on the canvas…

whitespaces canvas formulas

4 Likes

Thanks @Scott_Collier-Weir and @Pch ! I guess I wait until someone from Coda can explain why this happens. Maybe you can help @Eric_Koleda ?

The issue is that all canvas formulas have a horizontal padding

image

image

image

image

Removing padding makes it nice and flush.
image

I understand why it’s there, in 95% of the use cases it’s convenient to have it. The remaining 5% is a minor inconvenience like you said.

Removing the padding would mess up a lot of docs, instead I propose an option to be implemented inside the formula type selector somehow:

image

3 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.