Skip to main content
Inspiring
Feb 5, 2022 7:06 AM UTC
Solved

index Function on Map is not behaving correct

Hi All,

I have an Map operator which contains key value pairs as 

{eventId:6,actualsId:1,planId:2}

i saved it in a process variable in a script task and then when i tried doing the value as 

pv!map.eventId it is saving the value as 6,

if i do index(pv!map,"eventId",999) it is saving as 999 instead of 6.

Not sure what is the issue. Any one faced such kind of issue in process model.

Please Note : I tried this in Process model not in rule. In rule it is working fine.

    stefanhelzle0001
    Brainy
    Feb 5, 2022 9:45 AM UTC

    Did a quick test. Same behaviour here. For this does not look like expected. Try to open a support case.

    9 replies

    harshavAuthor
    Inspiring
    Feb 5, 2022 7:06 AM UTC

    [mention:126a676c85024855948336691b0a7b92:e9ed411860ed4f2ba0265705b8793d05] [mention:6b9f80ff18f9420082d13ef2d5121d56:e9ed411860ed4f2ba0265705b8793d05] Any thoughts on this please.

    stefanhelzle0001
    Brainy
    Feb 5, 2022 8:41 AM UTC

    Just some simple questions.

    Did you check that the pv is of type map?

    Did you check that the pv contains the expected values?

    harshavAuthor
    Inspiring
    Feb 5, 2022 9:13 AM UTC

    Yes [mention:126a676c85024855948336691b0a7b92:e9ed411860ed4f2ba0265705b8793d05] i did check them it is of type Map and the Map contains the expected values [emoticon:c4563cd7d5574777a71c318021cbbcc8]

    gopalk2865
    Participating Frequently
    Feb 5, 2022 1:13 PM UTC

    Hi Harshav, Yes index function is not working here but as of now , for work around you can use "dot" instead of index function.

    harshavAuthor
    Inspiring
    Feb 7, 2022 4:21 AM UTC

    Thats the way i am actually doing it as my workaround.