cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
prasadvenkat
Level: Powered On

Array variables - unique values

I am trying to get only the unique values from array variable (of strings) into a list so I can create html and email. Is this possible to get this through an expression? 

1 ACCEPTED SOLUTION

Accepted Solutions
SamPo
Level 10

Re: Array variables - unique values

@prasadvenkat use the 'union' expression to combine the array with itself to get a result of unique values. For example: 

 

union(outputs('myArray'),outputs('myArray'))

 

Hope this helps

 

Sam

View solution in original post

7 REPLIES 7
SamPo
Level 10

Re: Array variables - unique values

@prasadvenkat use the 'union' expression to combine the array with itself to get a result of unique values. For example: 

 

union(outputs('myArray'),outputs('myArray'))

 

Hope this helps

 

Sam

View solution in original post

prasadvenkat
Level: Powered On

Re: Array variables - unique values

thanks.. that works

NazIM
Level: Powered On

Re: Array variables - unique values

What action would you place this formula under?

Highlighted
SamPo
Level 10

Re: Array variables - unique values

You can place it wherever you want to display or use the output. The simplest option is to use the 'compose' action. You could also use a variable of type 'array'.
BastMani
Level: Power Up

Re: Array variables - unique values

 
Achavan
Level: Powered On

Re: Array variables - unique values

hi

i have used the same above but not able to get unique array.

Screenshot_3.png

 

 

SamPo
Level 10

Re: Array variables - unique values

@Achavan It looks like you're trying to wrap your array variable in another array.

 

Remove the array function and just use:

union(variables('Customer Array'),variables('Customer Array'))

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons in April

Read the announcement for more information!

firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,122)