I have been trying to create a very simple (lists to sql) power automate workflow that triggers when an item gets added/modified in Microsoft Lists and gets updated in my SQL DWH.
The Title column is the default single-line text field provided by Microsoft. The Comments column is a custom field with data type multiple-lines of text.
In SQL I created a straightforward table, which contains two columns 'Title' and 'Comments', both of type varchar.
The Flow I created looks like this:
During the first sharepoint action I connect to the sharepoint list, no advanced options. During the get rows(v2) action I connect to the created table in SQL, again no advanced options. In the condition step I included some basic logic that determines whether the item in the list is new or exists. In the final step, that inserts or updates the row based on its existence, I run into an error. While all the previous steps work perfectly fine, I run into a 502 BadGateway error saying that the Insert_Row action has failed. I have been stuck for the last couple of days and haven't been able to find the solution. My SQL DWH is located in Europe and the PowerApps environment is set to EMEA.
Can someone please help out?
Please find below the error report:
I had exactly this 502 and found it to be a data error in one of my fields (using a True/False into a Yes/No field). Once I realised that by properly looking at the Raw Output from the sql action, I fixed it and all ok now.
Thank you for the alternative! As soon as I found the issue that's causing the error when trying to update or insert rows into SQL i'll look into your proposed workaround!
Hello
Can you please provide flow URL and run URL
Have a good day
Hi rutgerverhaar
I can't help you with your problem, but I can propose an alternative means of achieving the same thing which may be a whole lot more efficient. Rather use the Execute a SQL Query and then use a "merge" query.
Flow would look like this
And sql query would be something like:
Merge into MyTable using
(...my data fetched from sharepoint...) spData
on (spData.Title = MyTable.Title)
WHEN MATCHED THEN
UPDATE SET
MyTable.Title= spData.Title,
MyTable.Comments = spData.Comments
WHEN NOT MATCHED THEN
INSERT ( MyTable.Title, MyTable.Comments)
VALUES (spData.Title, spData.Comments)
Hope that helps
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2