问题
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