Expand my Community achievements bar.

The next phase for Workfront Community ideas is coming soon. Learn all about it in our blog!

Searching for a Value in a Collection

Avatar

Level 9
Has anyone been successful in using IF, IFIN or CONTAINS expressions to search a collection for a particular value? If so, can you please share your syntax? Thank you!
Topics

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

4 Replies

Avatar

Level 10
Here you go. I use this in the documents list. Our PMs like to see Pending instead of New for approvals. valueformat=HTML listdelimiter= textmode=true valueexpression=IF(CONTAINS("NEW",{status}),"PENDING",{status}) type=iterate listmethod=nested(approvals).lists displayname=Approval Status

Avatar

Level 9
Thank you. I am not able to get this to work though. Here is my current syntax based on your example (also tried with just name, instead of category:name - no luck): displayname=IEC Form?? listdelimiter= listmethod=nested(objectCategory).lists textmode=true type=iterate valueexpression=IF(CONTAINS("IEC Status, Trend, Risks, Update, Goals",{category:name}),"Yes","No") valueformat=HTML The collection I am after is objectCategory, which contains the list of custom forms. The specific form name is: IEC Status, Trend, Risks, Update, Goals If that form is in the list, I would like it to say "Yes", otherwise "No". What is extra interesting is that with the syntax below I get commas as a result when the form I want, or one other, are in the list. displayname=IEC Form? listmethod=nested(objectCategories).lists textmode=true type=iterate valueexpression=IFIN("IEC Status, Trend, Risks",(objectCategories:category:name),"YES","NO") valueformat=HTML Attaching a screen shot of the list of forms, the comma field and the one I can't get working.

Avatar

Level 10
A few changes to your code. You don't need to spell out the complete wording for the custom form, you just need the unique value eg IEC. and then when using the value expression, instead of category:name, you use {category}.{name} displayname=IEC Form test listdelimiter= listmethod=nested(objectCategories).lists textmode=true type=iterate valueexpression=IF(CONTAINS("IEC",{category}.{name}),"YES","NO") valueformat=HTML

Avatar

Level 9
OMG! THANK YOU!!! That works! Looks like I wasn't referencing category:name correctly with curly brackets. It always comes down to grammar! Thank you again!