Multiple Trigger Formulas?

Hi,

I’m a relatively new Grist user, and a basic one at that (as in zero Python skills)! I’ve been looking at Trigger Formulas to help clean up data being entered into a table using a form but can’t work out how to string more than one formula together.

To try and explain, I want to make sure that when names are entered (first name and surname in two separate columns) they are converted to title case and have any leading or trailing spaces removed.

I’ve found the right formula for each case (value.strip() to remove spaces, and value.title() to convert to title case), but I can’t work out how to apply both to a single column.

Am I missing something really obvious, or is it just not possible?

Hey there!

Use parenthesis to apply the second method. Using your example, I first apply .strip() to the value, then apply .title() to the stripped value.

(value.strip()).title()

Hope this helps!

Natalie

Thanks Natalie - that has done the trick (interestingly, value.strip().title() without the extra parenthesis seems to work too!).

1 Like

Hi,

value.strip().title()

does the job. This is Python code, no need to have extra parenthesis!

1 Like