Extract date using index

I am trying to extract out an array from allResults which contains a certain ID . since ID is an integer , i used index and where contains 

 

index( local!allResults, wherecontains( ri!Id, tointeger(touniformstring( local!allResults.Id)) ) )

 

 

What if i have to extract an array which is greater than a  certain date  from allResults ?

 

If i want equals to i could have tried  

 

index( local!allResults, wherecontains( ri!date,  local!allResults.date)) ) )

 

 But i want to extract out an subset array from a master array , where the date in master array is greater than today 

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    Hi, instead of using wherecontains it sounds like you want to build something to the effect of "whereGreaterThan". You could do so inline by using a!forEach. Iterate over the list local!allResults.date, and for each item compare the value to ri!date. If the value is greater, return the index, otherwise, return {}. That way, you'll be passing an array of the indices you're after to fn!index, and it will return the subset array that you're looking for, because index's second (named index) parameter accepts arrays (index (Number (Integer)): The index or array of indices of the array.).

    If you're on an earlier version of Appian and a!forEach isn't available, you can accomplish the same thing by creating a new rule and using apply().

    Thanks,
    Dan
Reply
  • 0
    Certified Lead Developer
    Hi, instead of using wherecontains it sounds like you want to build something to the effect of "whereGreaterThan". You could do so inline by using a!forEach. Iterate over the list local!allResults.date, and for each item compare the value to ri!date. If the value is greater, return the index, otherwise, return {}. That way, you'll be passing an array of the indices you're after to fn!index, and it will return the subset array that you're looking for, because index's second (named index) parameter accepts arrays (index (Number (Integer)): The index or array of indices of the array.).

    If you're on an earlier version of Appian and a!forEach isn't available, you can accomplish the same thing by creating a new rule and using apply().

    Thanks,
    Dan
Children
No Data