Nov 26, 2021 03:24 PM
I have a measurement form. Users can add numbers into the appropriate fields (labeled number only fields). I think have a formula field that formats the numbers into something that can be readable.
Each field is added on its own line in a formula field with a * by it, so the end result looks like this (sample formula below):
CONCATENATE( IF({Height}, "* Height: " & {Height} & "cm\n"), IF({Head Circumference}, "* Head Circumference: " & {Head Circumference} & "cm\n"), IF({Neck Circumference}, "* Neck Circumference: " & {Neck Circumference} & "cm\n"), IF({Chest Circumference}, "* Chest Circumference: " & {Chest Circumference} & "cm\n"),
This works great. However I have an “Additional Measurements” field that is a long text field, where a user can add any missing measurements. For example:
Calf Circumference:
Hip Circumference:
I am wanting to know if I can add a * to each new line like in the other formula? The above user input would look like this:
Final end result would look like this:
Hopefully I explained this well enough. Right now the formula I modified looked like this:
It works, but it bothers me SO MUCH that the user added information only has a * by the first line and not the other lines. :expressionless:
Nov 26, 2021 04:54 PM
Absolutely! In addition to adding an asterisk at the start of the other field contents, you can turn each new line into a new line followed by an asterisk. I revised your formula to add this to the end, and also to remove the wrapping CONCATENATE()
function and just use the &
concatenation operator for the whole thing (you were already using it inside the IF()
functions, so this just makes the whole thing more consistent).
IF({Height}, "* Height: " & {Height} & "cm\n") &
IF({Head Circumference}, "* Head Circumference: " & {Head Circumference} & "cm\n") &
IF({Neck Circumference}, "* Neck Circumference: " & {Neck Circumference} & "cm\n") &
IF({Chest Circumference}, "* Chest Circumference: " & {Chest Circumference} & "cm\n") &
IF({Additional Measurements}, "* " & SUBSTITUTE({Additional Measurements}, "\n", "\n* "))
Nov 26, 2021 05:10 PM
That worked beautifully! Thank you!