Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure logic apps - how to create unique array from dynamic array?

i have dynamic array, meaning the value and length depends on my REST API call result.

i need to make that array has unique or distinct value, meaning the value inside the array must be unique to each other.

ANy idea?

Thanks

like image 665
system programmer Avatar asked Apr 20 '26 17:04

system programmer


1 Answers

The linked comment using union shows how but does a bit more than the original request so those that want the very simple answer to the question - how do I get the unique/distinct values from an array - all you do is union the array with itself, i.e.

enter image description here

and the expression in the 2nd initialise just does:

union(variables('TestArray'),variables('TestArray'))
like image 120
Simon Avatar answered Apr 23 '26 11:04

Simon