Combine 2 collections of data

#1

Hi there !

I have two collections of data :

one like this :
ABC : 100
DEF : 140
GHI : 160

and the other like this :
ABC : jkfk
DEF : ddsv
GHI : sddv

Now i would like to combine the two in order to get the following combination :

jkfk : 100
ddsv : 140
sddv : 160

how can i do this ?

thank you !

(Karen Barker) #2

Hi Frank,

How are you getting the collections into Flow XO? Also when you combine the 2 are you looking to have a collection output to use, or is it literally just to output the values in a message etc that you want them combined?

Thanks :slight_smile:

#3

Hi,

i’m getting these collection from two different json thanks to the {{output *}} function to get the keys list for each collection. I’m looking to a way to have each number element (100, 140, 160) related to his corresponding small caps list element (jkfk, ddsv, sddv), to then make a http request requiring each of these combinations.

thanks

(Karen Barker) #4

Hi Frank,

The best way to achieve this would be to use the code service. You’ll be able to iterate through the first data set, taking the first key name and then search through the second data set for this key. Then store the values for the key from each of the data sets in an array. Dependent on the format you require the data in for the http request you could for example turn the array into JSON which could be used in the HTTP request. :thumbsup: