web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Unexpected behaviour f...
Power Automate
Answered

Unexpected behaviour from Union function

(0) ShareShare
ReportReport
Posted on by 15

Hello,

 

I am attempting to return a list of distinct values from two array variables which contain a list of integers. However, when I use the Union function it simply merges the two lists of numbers together, creating duplicate values. These values even remain when I run a second Union function of the output against itself. The weirdest part is that when I copy these values into another test Flow I can get the Union function to behave how I would like it to.

 

Array 1 - insight_pns

emerson098_0-1675727727420.png

Array 2 - sharepoint_pns

emerson098_1-1675727751826.png

Results from Union function - union(variables('insight_pns'), variables('sharepoint_pns'))

emerson098_2-1675727790304.png

Results from second Union function - union(outputs('Compose'),outputs('Compose'))

emerson098_3-1675727859506.png

 

Any idea what's going wrong here? I tried to re-create the Flow and the error persists.

Categories:
I have the same question (0)
  • grantjenkins Profile Picture
    11,063 Moderator on at

    Can you click on Show raw outputs from your Compose (the first union) and check that they are all set as ALL numbers or All strings, or if there are any additional characters that you might not see otherwise.

     

    grantjenkins_0-1675729944350.png

     

  • emerson098 Profile Picture
    15 on at

    They appear the same to me?

    emerson098_1-1675730688095.jpeg

     

  • grantjenkins Profile Picture
    11,063 Moderator on at

    That seems kind of bizarre. Can you try adding some additional duplicate values into your arrays and see if they too don't get removed? Or is the data in your variables being extracted from somewhere?

  • emerson098 Profile Picture
    15 on at

    My upstream data sources are SharePoint and Excel. I use the int() function to convert the Excel value (stored as text) to an integer and have the SharePoint column set to "Number" with 0 decimal places.

  • Verified answer
    emerson098 Profile Picture
    15 on at

    The solution is I needed to transform my Excel data into float() instead of int().

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard