Skip to main content

Notifications

Power Automate - Building Flows
Unanswered

How to extract values from a specific field and separate them by commas

Posted on 21 Nov 2024 14:54:24 by 91
Hi Everyone!!

I have a 'Filter Array' action in Power Automate where I am extracting values from a specific field in the resulting array.
Below is an example of the filtered data I get back:
 
{
    "body": [
        {
            "ItemInternalId": "abc12345",
            "Contractor Name": "John Doe",
            "Assigned Enterprise ID": "john.doe",
            "Assignment ID": "12345",
            "Status": "Active",
            "Assignment Work Country": "Country A",
            "Project Name": "Project A",
            "Client Name": "Client A"
        },
        {
            "ItemInternalId": "xyz98765",
            "Contractor Name": "Jane Smith",
            "Assigned Enterprise ID": "jane.smith",
            "Assignment ID": "67890",
            "Status": "Active",
            "Assignment Work Country": "Country B",
            "Project Name": "Project B",
            "Client Name": "Client B"
        }
    ]
}
 
From this, I want to extract only the 'Assignment ID' values and return them as a string separated by commas, like this:

12345, 67890.

How can I achieve this in Power Automate? I'm looking for a solution that directly extracts these values and formats them as a comma-separated string.

Thank you for your help!
  • RaulLessa Profile Picture
    RaulLessa 2 on 21 Nov 2024 at 18:55:49
    How to extract values from a specific field and separate them by commas

    Hello!
    Here is the solution to extract only the 'Assignment ID' values and return them as a string separated by commas:

    Step 1: Add your JSON to a Compose action.

     

    Step 2: Add a Select action and populate the fields as follows:

    • From: outputs('Compose').body
    • Map: item()?['Assignment ID']
     
    Step 3: Add a Join action. In the From field, add the output of the Select action: body('Select').
    And Join with field add ", "
     
    Final Result:
    Hope this helps!

    If I helped you solve your problem—please mark my post as a solution.
    Consider giving me a đź‘Ť if you liked my response!
     
     
     

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

October 2024 Newsletter…

October 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #4 How to Conntact Support…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,051

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,793

Leaderboard