Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
3 replies
Subscribers
7 subscribers
Views
2274 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
I have a static/local variable having list of Data local!dataList: { {
niteshp
over 10 years ago
I have a static/local variable having list of Data
local!dataList: {
{id:9, name:"AAA"},
{id:3, name:"BBB"},
{id:2, name:"CCC"},
{id:5, name:"DDD"}
}
How can I fetch the item on the basis of Name ? eg get item where name="CCC"...
OriginalPostID-114534
OriginalPostID-114534
Discussion posts and replies are publicly visible
0
Rully
over 10 years ago
Will this work?
index(local!datalist, wherecontains("CCC", local!datalist.name))
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Jason Ruvinsky
Certified Senior Developer
over 9 years ago
Note that wherecontains() will return ALL indexes where that name appears. If you expect each name to only appear a single time, use lookup() instead.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Bishnu Panigrahi
Appian Employee
over 9 years ago
Check out the where() documentation:
forum.appian.com/.../Array_Functions
"index(pv!employees.firstName, where(like(pv!employees.department, "Finance"), -1), "None") returns all of the first names of employees in the Finance department, or "None" if none of the employees have their department field set to Finance."
The same logic can be applied to your scenario.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel