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

Notifications

Announcements

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
    68,707 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
    68,707 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard