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

Community site session details

Session Id : cGppxYbllZFDBR3g83wfCK
Power Automate - Building Flows
Answered

Perform an unbound action - Merge - How to use

Like (0) ShareShare
ReportReport
Posted on 14 Sep 2021 10:21:37 by 9

I am trying to use "Perform an unbound action" in a Power Automate to merge two contact records and struggling with the parameters required.

 

The Microsoft documentation suggests the following:

ChrisWP_0-1631614845236.png

 

However I don't know how to translate this to what Power Automate requires. This is my current configuration. There doesn't appear to be any documentation for this.

 

ChrisWP_1-1631614890084.png

 

  • fsuarezoedt Profile Picture
    46 on 06 Jun 2024 at 11:11:41
    Re: Perform an unbound action - Merge - How to use

    Hi @Expiscornovus !

     

    I have to merge clients with several fields and the conditions that ChrisWP mentioned. How do you suggest doing the merge with the "different collection functions"? I saw Microsoft page but it's not a "tutorial" kind of page and the information is very basic. Can you illuminate me or guide me?

     

    Thanks in advance,

    FSO

  • Expiscornovus Profile Picture
    32,177 Most Valuable Professional on 28 Sep 2021 at 10:39:16
    Re: Perform an unbound action - Merge - How to use

    Hi @ChrisWP,

     

    You can probably use a couple of empty functions to compare the two fields values and append the value to a separate string variable.

     

    This will still be manageable if we are only talking about 4 fields.


    Below is an example expression for this approach:

    if(empty(outputs('Get_a_row_by_ID_-_Account1')?['body/description']), if(empty(outputs('Get_a_row_by_ID_-_Account2')?['body/description']), '', concat('"description": "', outputs('Get_a_row_by_ID_-_Account2')?['body/description'], '"')), concat('"description": "', outputs('Get_a_row_by_ID_-_Account1')?['body/description'], '"'))

     

    buildupdatecontentfield.png

     

    If you want to do this for all the fields of the record I wouldn't recommend this approach. Than it is probably better to have a look at the different collection functions like union, intersection, etc.:

    https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#union

     

  • ChrisW6 Profile Picture
    9 on 22 Sep 2021 at 14:39:51
    Re: Perform an unbound action - Merge - How to use

    I have a new requirement with this to check for empty fields and populate the UpdateContext based on one or the other record.

     

    For example,

     

    Field 1: Target has no data in this field but Subordinate does. I want the subordinate value.

    Field 2: Target has data and Subordinate does not. I want to keep the target value.

    Field 3: Target has data and Subordinate has data. I want to keep target data.

    Field 4: Target has no data and Subordinate has no data. I do not want to update this field.

     

    I have tried writing an if statement to handle this but it does not work because you always have to have 3 parameters in if, in the situation where there is no data at all, the Merge action throws an error because I'm passing null.

  • Expiscornovus Profile Picture
    32,177 Most Valuable Professional on 14 Sep 2021 at 11:53:31
    Re: Perform an unbound action - Merge - How to use

    Hi @ChrisWP,

     

    That is definitely a gotcha in Power Automate. You always need to escape the @ character in the json with another @ character 😁

  • ChrisW6 Profile Picture
    9 on 14 Sep 2021 at 11:52:15
    Re: Perform an unbound action - Merge - How to use

    Perfect thank you, I was missing the double @@ in a previous attempt. Thanks so much.

  • Verified answer
    Expiscornovus Profile Picture
    32,177 Most Valuable Professional on 14 Sep 2021 at 11:50:24
    Re: Perform an unbound action - Merge - How to use

    Hi @ChrisWP,

     

    I tested a couple of things and also had a look at the Web API documentation:

    https://docs.microsoft.com/en-us/powerapps/developer/data-platform/webapi/merge-entity-using-web-api

     

    Can you try the below approach? In this example I am only merging the name field btw.

     

    mergerecords_viapowerautomate.png

     

    Normally in the interface you can also select the other fields. You need to specify those in your UpdateContent field as well.

     

    mergeaccounts_interface.png

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!