Transform two arrays into a map where the first array is the key and the second is the value

Certified Associate Developer

Hi,

I am parcticing with the a!queryRecordType() function and I realized in return one field called identifiers where the primiary key is returned and I would like to know if I could transform it together with the data field into a map where the identifiers values are the keys and the data values are the values.

For example:

Having:

identifiers : {12,20}

 data : {"first value", "second value"}

Transform it into

{12: "first value",

20: "second value}

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Lead Developer
    in reply to antonio chávez

    In this way you would duplicate the data you already have into another process variable. That is not memory efficient.

    Alternative to your solution you could:

    - Create an expression that returns the requested value based on rule inpuds: 1/ given id and  2/ data array (originating from your a!queryRecordType()).

    - Just query single item on given ID. Create seperate expression rule and set as script task data output in your PM.

    Both produce re-usable components that make sense when building an Appian application.