Help

Combining fields and add a star to each new line?

Topic Labels: Formulas
704 2
cancel
Showing results for 
Search instead for 
Did you mean: 
Deko
7 - App Architect
7 - App Architect

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):

  • Height:
  • Bust:
  • Waist:
  • Thigh:
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:

  • Calf Circumference:
  • Hip Circumference:

Final end result would look like this:

  • Height:
  • Bust:
  • Waist:
  • Thigh:
  • Calf Circumference:
  • Hip Circumference:

Hopefully I explained this well enough. Right now the formula I modified looked like this:

  • Height:
  • Bust:
  • Waist:
  • Thigh:
  • Calf Circumference:
    Hip Circumference:
    Foot Width:

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:

2 Replies 2

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* "))

That worked beautifully! Thank you!