Sub-process input variable: Cannot index from an array using tp[instanceIndex]

Hi everyone, I'm having this issue where I'm trying to index a date and time array using the index of caseID from another array with same order. Below are the process variables and the code that I wrote:

allCases Number (Integer) 3,061,158; 3,061,157; 3,061,156; 3,061,155; 30,611,111; 306,115,555

updatedDateTime Date and Time 20 May 2023 12:00; 21 May 2023 12:00; 20 Jun 2023 12:00; 6 Dec 2023 12:00; 20 May 2023 12:00; 20 May 2023 12:00

However there was no updatedDateTime value passed into my sub-process, so I'm wondering what did I do wrong with the indexing.

Any idea? Thanks a lot in advance :)

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Are casesWithTasks and allCases same type? Is pv!updatedDateTime an array/dictionary? First i will take your where contains and check it manually if it ever return any true for any tpinstanceinex. Then check if index of pv!updatedDatetime return anything if you provide 1 or 2 as second argument.

  • Yes. casesWithTasks and allCases are both integer. updatedDateTime is now Date and Time (multiple values) type. 

    I created a scriptask and tried index(pv!updatedDateTime,wherecontains(pv![a case ID instead of pv!casesWithTask[tp!instanceindex],pv!allCases),null), this will return me the exact date time at that index. But it does not work with tp!instanceIndex not sure why... 

Reply
  • Yes. casesWithTasks and allCases are both integer. updatedDateTime is now Date and Time (multiple values) type. 

    I created a scriptask and tried index(pv!updatedDateTime,wherecontains(pv![a case ID instead of pv!casesWithTask[tp!instanceindex],pv!allCases),null), this will return me the exact date time at that index. But it does not work with tp!instanceIndex not sure why... 

Children