I'm trying to concatenate JSM form values to create an address but ONLY if they have a value in them. The smart values for the form fields are as follows
{{issue.forms.1f28bc04-0d32-402a-8b0e-d34cce50096c.in-emp-subloc-3}}
I'm currently using the following smart value with concat() and if() functions:
{{concat(issue.forms.1f28bc04-0d32-402a-8b0e-d34cce50096c.in-emp-subloc-3, if(issue.forms.1f28bc04-0d32-402a-8b0e-d34cce50096c.in-emp-subloc-3, ", "), issue.forms.1f28bc04-0d32-402a-8b0e-d34cce50096c.in-emp-subloc-2, if(issue.forms.1f28bc04-0d32-402a-8b0e-d34cce50096c.in-emp-subloc-2, ", "), issue.forms.1f28bc04-0d32-402a-8b0e-d34cce50096c.in-emp-subloc, if(issue.forms.1f28bc04-0d32-402a-8b0e-d34cce50096c.in-emp-subloc, ", "), issue.forms.1f28bc04-0d32-402a-8b0e-d34cce50096c.iin-emp-locality)}}
The form fields are as follows:
So, for example, given the following set of values:
The output would be: Box 34, Unit 5, Yerendra Square, Western Arm, Yarani
But given the following set of values:
The output would be: "Yerendra Square, Western Arm, Yarani", not ", Yerendra Square, Western Arm, Yarani"
However, when I try to return the smart value above, I just get an empty string.
Any ideas?
First thing: detecting empty (or blank) fields is not always simple in rules. Their field types, context, and whether or not they had a value which was cleared make things challenging. And...
Rules do not support nesting conditions within the concat() function. Please try using individual conditional expressions, side by side, storing the result in a created variable. Then use text functions to remove any stray values.
Or easier still, place all of the values side-by-side with comma-delimiters, storing in a variable. Then split() the values and use match() to remove any empty values. You may need to adjust this if any of your field values could contain commas (such as by changing the delimiter to a tilde ~).
For example, with some fake form field names:
Kind regards,
Bill
Hi there, @Bryan Guffey , great use-case! Can I ask if this is through automation, and if so, are you outputting to a larger paragraph field (e.g., description) or some other shorter custom field?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.