Hello, i need some help i need to dynamically delete items from some arrays
My arrays are like this:
[
[1,2,3],[1,2,332],[1,22,113],[1,223,323]
]
And
First: I need to calculate the quantity of items so, exist a function like: quantity(myArray)
Second: I need to delete some items of my array, example: like the 3 first items
[
[1,223,323]
]
And get something like this
How can i do this?
Solved! Go to Solution.
Hi @madmvx
Thank you for posting.
You can use the ‘length’ and ‘skip’ function to get the array you want.
Please refer to the screenshot as below:
You can use ‘Length’ function to return the number of items in the array.
Expression:length(variables('myArray'))
Than you can use ‘skip’ function to remove items from the front of a collection, and return all the other items.
Expression:skip(variables('myArray'),add(outputs('Compose_2'),-1))
After the flow runs,you will get the array as below:
For more info about functions you can refer to this document.
https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference
Hope the content above may help you.
Best Regards
Lily
Hi @madmvx
Thank you for posting.
You can use the ‘length’ and ‘skip’ function to get the array you want.
Please refer to the screenshot as below:
You can use ‘Length’ function to return the number of items in the array.
Expression:length(variables('myArray'))
Than you can use ‘skip’ function to remove items from the front of a collection, and return all the other items.
Expression:skip(variables('myArray'),add(outputs('Compose_2'),-1))
After the flow runs,you will get the array as below:
For more info about functions you can refer to this document.
https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference
Hope the content above may help you.
Best Regards
Lily
Thanks, this works very well
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
At the monthly call, connect with other leaders and find out how community makes your experience even better.
User | Count |
---|---|
26 | |
24 | |
24 | |
21 | |
18 |
User | Count |
---|---|
58 | |
41 | |
37 | |
30 | |
30 |