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 : VqPdWclkIE7k9s1loiR/wP
Power Automate - Building Flows
Answered

Merging two datasets (SQL + JSON)

Like (1) ShareShare
ReportReport
Posted on 29 May 2024 18:52:04 by 22

I have two data sources, a SQL Server Query and a JSON Output from an API call. 

Both actions return the data successfully.

 

I'd like to create a single dataset with all the columns from the SQL server query and just one column (Account ID) from the JSON output. The column from the JSON output needs to be added based on the SQL Server Account field matching the JSON AcctNum field. (Account = AcctNum)

 

I am stuck and looking for guidance on creating the master dataset.

  • Verified answer
    wkrinsky Profile Picture
    22 on 30 May 2024 at 05:59:09
    Re: Merging two datasets (SQL + JSON)

    Interestingly enough, I did this successfully using the following video for guidelines: https://www.youtube.com/watch?v=QSF6dNkSKSA

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 2 on 30 May 2024 at 04:50:12
    Re: Merging two datasets (SQL + JSON)

    Hi @wkrinsky 

     

    You can try using XML & XPATH with some expressions to join json arrays.

     

    Here is my blog for joining the arrays, you can try the same technique for your case:

    Microsoft Power Platform Join arrays efficiently without using loops in Power Automate Select (manish-solanki.com)

     

    If you face problem then you can share the json arrays with sample data, I will try to share a sample flow to join those arrays.

     

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

     

  • wkrinsky Profile Picture
    22 on 30 May 2024 at 01:11:29
    Re: Merging two datasets (SQL + JSON)

    Yes, my JSON is an array in both cases. When this runs the two datasets are moved into array variables with data that looks like this:

    Data:
    {
    "Name": "Customer 1",
    "Description": "Charges Principal",
    "Account": "1505",
    "PostingType": "Credit",
    "Amount": 500
    }
    Account:
    {
    "Name": "Mortgage Interest Earned",
    "SubAccount": true,
    "ParentRef": {
    "value": "83"
    },
    "FullyQualifiedName": "Other Income: Interest Earned",
    "Active": true,
    "Classification": "Revenue",
    "AccountType": "Income",
    "AccountSubType": "OtherPrimaryIncome",
    "AcctNum": "1505",
    "CurrentBalance": 0,
    "CurrentBalanceWithSubAccounts": 0,
    "CurrencyRef": {
    "value": "USD",
    "name": "United States Dollar"
    },
    "domain": "QBO",
    "sparse": false,
    "Id": "99",
    "SyncToken": "0",
    "MetaData": {
    "CreateTime": "2024-05-27T22:37:02-07:00",
    "LastUpdatedTime": "2024-05-27T22:37:02-07:00"
    }
    }

    I would like to look up the account id based on the account = acctnum. In this case it would be 99.

     

    wkrinsky_0-1717031288004.png

     

  • abm abm Profile Picture
    32,506 Most Valuable Professional on 29 May 2024 at 22:44:03
    Re: Merging two datasets (SQL + JSON)

    Hi @wkrinsky 

     

    Is your JSON Output is an array of data. Try the Filter Array step to filter using the condition equal to SQL Account field value. Once the Filter is done then you can use the JSON Filtered data and the SQL server data for the master data.

     

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!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Loading complete