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:
Solved! Go to Solution.
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
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
Hello
Can you please provide flow URL and run URL
Have a good day
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!
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.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
2 | |
2 | |
2 | |
1 | |
1 |
User | Count |
---|---|
5 | |
3 | |
3 | |
2 | |
2 |