cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

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
Impactful Individual
Impactful Individual

@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

8 REPLIES 8
Impactful Individual
Impactful Individual

@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

thanks.. that works

Frequent Visitor

What action would you place this formula under?

Impactful Individual
Impactful Individual

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'.

 

hi

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

Screenshot_3.png

 

 

Impactful Individual
Impactful Individual

@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'))
Microsoft
Microsoft

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (7,715)