Getting a calculated field to display data from several typeahead fields | Community
Skip to main content
Level 4
October 24, 2024
Question

Getting a calculated field to display data from several typeahead fields

  • October 24, 2024
  • 2 replies
  • 1378 views

Hi All,  I'm trying to create a calculated field that uses IF(ISBLANK logic to only display the typeahead that has data entered (only one field will have data due to display logic in the form).  Example below:

 

IF(ISBLANK({DE:typeahead field 1}.{name}),IF(ISBLANK({DE:typeahead field 2}.{name}),{DE:typeahead field 1}.{name}), {DE:typeahead field 2}.{name}))
 
my calculation isn't working and WF doesn't recognize the typeahead field names when I enter them into the code.
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Level 4
October 24, 2024

I cleaned it up a bit but it returns a value of N/A.

Level 2
October 25, 2024

Hi Omaha,

 

This is a tricky one. If I recall (and I may be mistaken on this) typeahead fields act a little different than most fillable/selection custom fields. Rather than have the separator "." you should combine the expression field with ":". See my clean up below. 

 

IF(ISBLANK({DE:Typeahead Field 1:name}),IF(ISBLANK({DE:Typeahead Field 2:name}),"N/A",{DE:Typeahead Field 2:name}),{DE:Typeahead Field 1:name})

 

The N/A is in there if both fields are blank and good to spot check. 

 

Best,

Joaquin

 

If this helped, please mark this as answered so others can find it. 

Level 4
October 25, 2024

I tried that but even when one of the typeahead fields is populating is still produces N/A in the calculated field. Should I concat the fields first before running a calculation?

 

Level 2
October 25, 2024

Joaquin, 

I took your code and swapped out IF(ISBLANK with CONCAT and was finally able to get something to output.  Only issue now is if there are more than one field filled, how do I separate them with a "," or a "|"?


If you can see use cases where more than one is filled, then you may want to consider creating a column for each. Depending on your report, it might be best to group so you don't have 12 separate columns. Just one with 12 potential answers.