Insert missing values in Sharepoint Online usning Azure Logic App

Viewed 224

I've a SQL Server table with a column Manufacturer with 4 rows:

Integral Coach Factor
Bharat Heavy Electricals Limited
Chittaranjan Locomotive Works
Golden Work Railway Workshop

Same data is available in a Sharepoint List as well:

Integral Coach Factor
Bharat Heavy Electricals Limited
Golden Work Railway Workshop

My task is to run a logic app every 24 hours and insert the missing values in the Sharepoint list. For the above example, I would need to insert only Chittaranjan Locomotive Works in the sharepoint as it is missing in the sharepoint list.

I'm new to Azure Logic App, and need some help to accomplish the task.

Any help will be highly appreciated.

1 Answers

For your requirement, please refer to my logic app shown as below:

1. Now I have a table shown like: enter image description here

2. Go to logic app, use "Get rows(V2)" action to get rows of the table. enter image description here

3. Then use "Get items" action to get all of the items in your sharepoint list. enter image description here

4. Use "Select" action to select the "Title" of each item of the sharepoint list. And input "Manufacturer" as "key" of each "Title". enter image description here

5. After that, use "For each" to loop the value from "Get rows(V2)". enter image description here

6. In "For each" loop, add a "Compose" action with content like below: enter image description here

7. After the "Compose", add a "Condition" to judge if it exists in sharepoint list. Choose Output of "Select" action as content of first input box and choose Output of "Compose" action as content of second input box. enter image description here

8. If "false", create item with current "Manufacturer" as its "Title". enter image description here

Related