Hi,
Scenario:
Please review the below code:
with( local!events: rule!GetAllEventsExpressionRule(), /*CARD 1: Events to be confirmed*/ local!statusList: rule!GetStatusList().result.body, local!ETBC_tempArray: {}, local!ETBC_filteredArray: a!forEach( items: displayvalue( tostring( displayvalue("Pending", index(local!statusList, "Status",{}), index(local!statusList,"Id",{}),{})), index(local!events.data, "Status",{}), index(local!events.data, "RequestedDate",{}), {}),
rule!GetAllEventsExpressionRule(): this returns a an object of event data.
rule!GetStatusList() returns an object of the status list.
I have an outer displayvalue() function that evaluates to: (3)
The inner displayvalue() takes the following parameters:
I am expecting the inner displayvalue() function to return dates, based on the status list array that I have provided.
At the moment, I only ever got one result back, regardless of there being more than one entry that match my date expression logic in the a!foreach variable.
What am I doing wrong?
Discussion posts and replies are publicly visible
The displayvalue function always returns one result. You should try something like the below. You may need to cast one of the parameters of the wherecontains to ensure matching types.
index( index(local!events.data, "RequestedDate", {}), wherecontains( <value>, index(local!events.data, "Status", {}) ), {} )