cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Impactful Individual
Impactful Individual

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

8 REPLIES 8
Highlighted
Impactful Individual
Impactful Individual

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

Highlighted
Helper I
Helper I

Re: Array variables - unique values

thanks.. that works

Highlighted
Frequent Visitor

Re: Array variables - unique values

What action would you place this formula under?

Highlighted
Impactful Individual
Impactful Individual

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'.
Highlighted
New Member

Re: Array variables - unique values

 
Highlighted
Helper I
Helper I

Re: Array variables - unique values

hi

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

Screenshot_3.png

 

 

Highlighted
Impactful Individual
Impactful Individual

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

Re: Array variables - unique values

Helpful resources

Announcements
Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Users online (6,580)