Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Combine values with common ID into single value

(0) ShareShare
ReportReport
Posted on by 2

I have the following array:

 

[
  {
    "ID""27",
    "Value""ICT|f7df09b2-e931-4a27-a2cc-975440062d12"
  },
  {
    "ID""27",
    "Value""ICT|f7df09b2-e931-4a27-a2cc-975440062d12;Quality and Safety|90ceaeb1-7dfb-466c-a292-532e9725a6eb"
  }
]
 
I need to convert this array into a single object that I can append to another array, in the form of:
 
  {
    "ID""27",
    "Value""ICT|f7df09b2-e931-4a27-a2cc-975440062d12;ICT|f7df09b2-e931-4a27-a2cc-975440062d12;Quality and Safety|90ceaeb1-7dfb-466c-a292-532e9725a6eb"
  }
 
It doesn't matter that this contains a duplicate as Power Automate resolves this in a later step, but I do need to get all the options in a single value.
 
So far I've been mucking around with union/select/replace to try to achieve it but I'm out of my depth so would appreciate some guidance!
 
Cheers, 
 
Rob
  • Paulie78 Profile Picture
    8,416 Super User 2025 Season 1 on at
    Re: Combine values with common ID into single value

    This may work for you (if I understand correctly):

    2022-08-21_14-03-08.png

    The code on the left side of the filter array is:

    length(split(item()['Value'], '|'))

    All that is happening is any entry within the array that does not contain 3 values delimited by a pipe symbol in the value property is removed. Which leaves you with one entry in the array:

    [
     {
     "ID": "27",
     "Value": "ICT|f7df09b2-e931-4a27-a2cc-975440062d12;Quality and Safety|90ceaeb1-7dfb-466c-a292-532e9725a6eb"
     }
    ]

    The the final compose just gets the first entry in the array which is your object.

     

    Blog: tachytelic.net

    YouTube: https://www.youtube.com/c/PaulieM/videos

    If I answered your question, please accept it as a solution 😘

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492