Expand my Community achievements bar.

Latest Community Ideas Review is Out: Discover What’s New and What to Expect!

Getting a calculated field to display data from several typeahead fields

Avatar

Level 3

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.
Topics

Topics help categorize Community content and increase your ability to discover relevant content.

8 Replies

Avatar

Level 3

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

Avatar

Level 2

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. 

Avatar

Level 3

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?

 

Avatar

Level 2

It should work. I tested to make sure there weren't any other surprises.

 

Here's a couple steps I take when I know an expression should work but some how doesn't....

1) Double check the spelling on your custom fields.

2) Double check that the fields are filled out. You may need to do a spot check with filters for specific objects you are pulling data from. i.e. Object Name is equal to "Name of Object"

3) Lastly, this seems obvious, but it's one I've even fallen victim to, make sure the data is in the right object for the report you've created. i.e. in a project custom form for a project report. 

 

Best,

Joaquin

Avatar

Level 3

everything looks good.  I did a test to bring in one of my typeahead fields into a calculated  field to convert to text and it worked. there are about 12 typeahead fields that I was trying to bring in, and on each task form they are associated with, only 1 of the 12 will be filled out.  Is it possible that I'm getting N/A as a return because they are all not filled out?

 

Avatar

Level 3

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 "|"?

Avatar

Level 2

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. 

Avatar

Level 2

Yes, N/A will show when none of the fields are filled out (zero filled). If more than one is filled, it will grab the first one it finds and add that as your return.