Hi, and thanks for reading.
I have a field that I want to concatenate several other fields into. Right now my formula looks like this:
Accounting + Baking + CleanupSetup
And the resulting field is all three of those without any spaces/commas. Like this:
AccountingBakingCleanupSetup
I thought about adding + ", " between each, but then if fields are empty there are lots of extra commas.
Is there a way to craft a formula something like, “Grab data from these fields, put them together with commas in-between.”
Thanks for any direction - I’m sure it’s in the documentation but I think I’m having trouble coming up with the right terminology to search for.
Thanks again,
Biagio
gary
September 27, 2019, 12:27am
2
Try:
arraystrip(Accounting +", "+ Baking +", "+ CleanupSetup,", ")
This will add the field values together separated by a comma and space and then the arraystrip( function will remove any extraneous comma/space separators containing blank field values. If all the fields are empty the result is an empty string.
1 Like
The sandwich( function is handy for this sort of thing.
1 Like
Thanks so much, Gary! That totally worked. Appreciate you taking the time.
Best,
Biagio
Thanks Bruce! I definitely wasn’t searching the documentation for “sandwich” - but I found it now! Have a great night, and thanks for the tip.
Biagio
admin
September 27, 2019, 2:21am
6
I have three suggestions for you to investigate, two of which have already been mentioned - arraystrip(, sandwich( and yoke(. I use all three at different times.
1 Like
I vaguely remembered yoke(, but it is not listed in the Help documentation’s See Also for sandwich(. I guess that should be added.
Thanks so much, Jim! Looking them up now. Appreciate the direction.
Best,
Biagio