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
It is possible to do this but it's a rather non-standard scenario. What are you trying to achieve by creating this map?
I'm making a process model where I get an ID and I have to look up in the result of an a!queryRecordType() that I had already saved in an array and I thought the fastest way to do it was to make a map instead of an array where the key were the ID I'm looking for.
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.