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 / Union function not wor...
Power Automate
Unanswered

Union function not working as expected

(0) ShareShare
ReportReport
Posted on by 21

Hello, 

I am trying to extract unique dates from a filter array of dates using compose action with union function but encountered the following error:

Bee1_0-1657320354919.png

 

I checked the expression but unable to spot any problem with it. Much appreciate any help to troubleshoot this issue. The union expression I used is 

union(outputs('Compose_2__-__Get_Booking_Dates_'),outputs('Compose_2__-__Get_Booking_Dates_'))
 

Bee1_1-1657320452032.png

 

Thanks in advance for your help.

@ekarim2020 

@reza dorrani

 

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,022 Most Valuable Professional on at

    Union() is designed to work on arrays and you are feeding it a string date.  What does your Compose 2 formula look like?  It should be an array of dates, but it's evidently returning a string.

  • Bee1 Profile Picture
    21 on at

    Hi, Pstork1

     

    Thanks for the quick response. Compose2 formula is as follows:

     
    body('Filter_array_EXCEPT')[0]['BookingDate']
     
    Filter array Except is filtering a SharePoint lists of booking dates that is not in another list. 
     
    The output of Compose 2 is as shown below:
    Bee1_0-1657327103937.png

    I need to get the unique booking dates. I need to get unique dates to create item in another list. Therefore I used the union function. But actually it looks like the Compose2 is showing 1 date although the Filter array Except identify 17 exceptions of the same booking dates. Therefore second Compose with union function is not needed? Appreciate if you can advise. 

     

    Bee1_1-1657327575946.png

     

     
  • Pstork1 Profile Picture
    69,022 Most Valuable Professional on at

    The problem is that your Compose is selecting just the first record of the array, you have specified the index [0].  So you are passing a string value to the Union(), not an array.  I think what you want to use for the Union is the output of the filter array, not the compose.

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!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 77 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 68

#3
Expiscornovus Profile Picture

Expiscornovus 56 Most Valuable Professional

Last 30 days Overall leaderboard