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 / Combine values with co...
Power Automate
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
Categories:
I have the same question (0)
  • Paulie78 Profile Picture
    8,424 Moderator on at

    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

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 796

#2
Valantis Profile Picture

Valantis 568

#3
Haque Profile Picture

Haque 538

Last 30 days Overall leaderboard