Hello everyone,
I have a local variable that query data from data table.The data looks like below:
local!cases: {
(clientId: 234,group: 55),
(clientId: 600, group: 66),
(clientId:234, group: 77),
(clientId: 600, group: 88),
(clientId: 234, group: 99)
}
I want to get the group name of only client number 600. Below is my code:
index(local!cases.group,wherecontains(600,tointeger(local!cases.clientId)),null),
And got this error: Invalid index: Cannot index property 'group' of type Text into type List of Number (Integer)
Any one got an idea what the reason is? Thanks a lot!
Discussion posts and replies are publicly visible
Are you sure that your data really looks like this?
This: (clientId: 234,group: 55),
is not an Appian dictionary. It should use curly brackets: {clientId: 234,group: 55},
Can you share a better working code example?
Sorry I was trying to create a similar data as mine was a list queried from DB.
The right format should be as you said:
{clientId: 234,group: 55},
{clientId: 600, group: 66},
{clientId:234, group: 77},
{clientId: 600, group: 88},
{clientId: 234, group: 99}
I’ve checked and group is actually a list of number(integer), not text as stated
This works perfectly fine for me.
a!localVariables( local!cases: { {clientId: 234,group: 55}, {clientId: 600, group: 66}, {clientId: 234, group: 77}, {clientId: 600, group: 88}, {clientId: 234, group: 99} }, index(local!cases.group,wherecontains(600,tointeger(local!cases.clientId)),null), )