I have exhausted looking for an answer so I am going to ask.
I have 2 arrays and I need to join them so that I can then have my table created from a single array and send it out. Here are the arrays:
Array1
Names from a name picker
{
"Resource Name": "First Last"
}
2nd Array has a number that is a string input on the front end form but I convert to an array so it looks like this
{
"percent": "100"
}
The first array might have 1 or 20 names in it and the 2nd array will have the same number of items as the first array. I need to add the 2nd array to the first as a property so that it comes out like this:
[
{
"Resource Name": "First Last",
"Percent Allocated": "100"
},
{
"Resource Name": "First Last",
"Percent Allocated": "50"
}
]
How do I merge the arrays based on position of the items, for instance the 2nd array [0] goes to the first array [0] as a property and so on throughout the total number of items?
Thank you in advance!
Mokono
Solved! Go to Solution.
Here is one solution:
The end result looks like this (partial screen shot):
Here is one solution:
The end result looks like this (partial screen shot):
Hi, @Mokono, there's quite a few answers here that might've helped you, but it can be done in a single step with a bit of creative expression writing!
So ... a quick and easy way to do this is to take the two arrays and then select them into one array, using a range() expression in its From field.
In my example, below, you will see that I am referencing my two 'mock' variables, here, but yours will be different references ... just change variables('arrayOneVAR') / variables('arrayTwoVAR') to point to your arrays:
|
What this does is:
|
|
Hope this helps!
In the append to array box, what is the expression you are using to pull in each of the different array items as it is cutoff in the screenshot.