cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kevinsa
Helper I
Helper I

JSON output to Azure SQL

Hi everyone, 

I am trying to build a flow that will take output from parsed JSON and...

 

IF JSON_ITEM_NUMBER exists in SQL_ITEM_NUMBER then UPDATE a SQL row. 

IF JSON_ITEM_NUMBER does not exist in SQL_ITEM_NUMBER then INSERT SQL row. 

 

 

kevinsa_0-1637975120143.png

 

This is as far as I have been able to get. No matter what, no rows are inserted or updated. Surely I'm missing a simple step. 

 

5 REPLIES 5
iltoningui
Super User
Super User

Hi @kevinsa 

 

Please read the SQL Connector limitations

and ensure that you table contains an identity column and a ROWVERSION column.

 

Hope this helps

Consider marking this as a solution

Hi @iltoningui 

 

I don't believe this is any limitation to the SQL connector. I am able to insert or update from my JSON output without problem. Demonstrated by a manually entered condition:

 

kevinsa_0-1638192741852.png

 

The issue I am having is trying to figure out the condition, because I want to compare each item_number from the JSON output to the item_number I'm returning from GetRows. 

 

iltoningui
Super User
Super User

Hi @kevinsa 

Can you share a print of the flow run, the loop part, to help me understand.

iltoningui_0-1638212398475.png

kevinsa
Helper I
Helper I

Hi @iltoningui 

 

This is all I can observe - I can't expand any further and on an empty table, there are no rows inserted.

 

kevinsa_0-1638232760304.png

 

iltoningui
Super User
Super User

Hi  @kevinsa 

It seems that the inner loop array is empty, that's why the condition isn't running.

Solution:

    Test to see if the database rows count is 0 if so the insert the json without the testing the number, if the database rows count > 0 then run the flow as you have it

 

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (1,701)