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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Query JSON by specific...
Power Automate
Unanswered

Query JSON by specific property (for inserting into SQL Server, or other)

(0) ShareShare
ReportReport
Posted on by 12

Hi all,

 

I have a long JSON coming from an API call and I need to store the values in a SQL table. 

My issue is that I need to be able to direct the <Insert row (V2)> to select the correct item from the array to put into the right SQL column. I can do it by referencing it with the [0],[1] etc, but as soon as the structure of the initial API data changes (which it will) the Insert Row will no longer properly work.

 

What I would like is to be able to dynamically filter using the ID (or label) into the relevant fields for the Insert Row action.

I would like to avoid needing to create a <filter> action since I have potentially several hundred of them to create.

Example with SQL syntax:

MarcDussault_1-1715135760204.png

 

 

{
 "body": [
 {
 "ID": "163716684587818",
 "label": "Sexe",
 "value": "Féminin"
 },
 {
 "ID": "163716691587418",
 "label": "Date de naissance",
 "value": "01/05/2000"
 },
 {
 "ID": "163716696241718",
 "label": "Ville de naissance",
 "value": "Paris"
 }
 ]
}

 

 

MarcDussault_0-1715135480030.png

 

Categories:
I have the same question (0)
  • SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at

    @MarcDussault 

    You can create variables to store the values you want to insert into the SQL table. For example, create variables named "ID", "label", and "value". These variables will hold the extracted values from the JSON data using XPath expressions.

    • For example, if you want to extract the "label" property from the JSON array, you can use the XPath expression
      xpath(body('Parse_JSON'), 'string(/body/label)')
      .

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard