Pick up records from SharePoint List based on Max value of Created field using Azure Logic App

柔情痞子 提交于 2021-01-28 09:06:15

问题


I've a SharePoint List with 652 rows. Created (Record Created Timestamp) and Modified (Record Updated Timestamp) are two inbuilt fields of the SharePoint List.

Staging all these 652 records along with the Created and Modified columns in an on-premise SQL Server Table using Azure Logic App. I've created the Created and Modified columns in SQL Serveras VARCHAR(100). Example of a Created column value in SQL Server table - 2021-01-15T06:43:00Z

Now, my aim is to select Max(Created) and Max(Modified) from the SQL Server table and from the next time I would like to get values from the SharePoint if the SharePoint Created field is greater than SQL Max(Created) or SharePoint Modified field is greater than SQL Max(Modified)

Is this doable using Azure Logic App?

Any help is going to be highly appreciated. Thanks in advance.


回答1:


Here provide two options for you to choose:

1. You can consider to use "When an item is created or modified" trigger of sharepoint connector in your logic app. If this trigger can meet your requirement, you do not need to check the max date of "Created" and "Modified" column.

2. If the trigger in option 1 can't meet your requirement, you can use a query like: select max(created) as maxcreated from table in "Execute a SQL query (V2)" action. Below is my logic app:

The expression in "Initialize variable" action is: body('Execute_a_SQL_query_(V2)')?['ResultSets']?['Table1'][0]?['maxcreated']

Run the logic app, the result shows:



来源:https://stackoverflow.com/questions/65803982/pick-up-records-from-sharepoint-list-based-on-max-value-of-created-field-using-a

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!