displayvalue() logic is only returning one result, despite multiple records of data matching conditions

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:

  • 1st index() returns the following array: {3,2,3};
  • 2nd index() returns the following array {2018-09-22T11:07:00, 2018-09-22T11:07:00, 2018-10-21T11:30:00}.

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