cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kdp321
Frequent Visitor

SQL Insert Row - Parse JSON inserting only NULL rows

Hi everyone,

 

I have build a flow to be triggered when a new Excel file is uploaded to a SharePoint folder. The flow takes a table in the Excel file and then inserts each row in a SQL table.

 

As an outline, this is what the flow looks like:

 

kdp321_1-1626684897991.png

The "Parse JSON" operator looks like:

 

kdp321_2-1626684958795.png

And the "Insert row" for SQL, where each field in the SQL table is linked to the corresponding field in the JSON:

kdp321_3-1626685082740.png

 

The problem comes when I run the flow, the JSON outputs contain the data from the Excel table, but the are not input into the SQL connector. The output of the Parse JSON, which contains data as highlighted:

kdp321_5-1626685290022.png

However in the SQL connector the output does not make sense:

kdp321_6-1626685347606.png

And in the corresponding SQL table, the flow does write into the SQL table but the values remain NULL:

 

kdp321_7-1626685412142.png

 

 

 

 

 

5 REPLIES 5
ScottShearer
Super User III
Super User III

@kdp321 

Can you tell me why you are using the Parse JSON action rather than just referencing the Excel columns from Dynamic properties when inserting a row?

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Thanks @ScottShearer 

 

The flow is triggered when a user adds a new excel file, and then the table in that new file has to be uploaded to SQL. The problem that I have is, because I'm not linking my flow to a specific file, I'm not able to link those columns in excel table to the corresponding fields in my SQL table. When I look under my dynamic properties in the SQL connector, all I see are these:

 

kdp321_0-1626759395649.png

 

For me to be able to do that I would need to see the names of the corresponding fields from my Excel table, right?

@kdp321 

Is the Excel file structure, table names, etc. the same for each file and just the name is different?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

@ScottShearer - yes. So my idea is to have the user upload an excel file which contains a preconfigured table every week. So the excel files will have different names, but the table I want to extract has the same structure every week

kdp321
Frequent Visitor

SOLVED:

 

What I did was place the Insert Row in SQL after the Parse JSON connector:

 

kdp321_0-1626947053262.png

 

And then to map the Parsed JSON to specific fields in my SQL table I used the expression - "items()?['column_names'] for each column in SQL. After the first run, the connection to my excel table was established and it's working perfectly

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (3,280)