Get latest ItemID from list with workflow
-
07-10-2020 - |
Вопрос
how can I get the latest ItemID from a list with a Sharepoint workflow? Like these SQL Statement:
SELECT MAX(id) FROM list WHERE title = "example1"
Is there any solution? Thanks!
Решение
TSQL-like language for querying SP lists is called CAML.
To get the latest ID you can construct CAML to sort items by Created
date from newest to oldest, while setting rowlimit
= 1
To CAML-query lists in SharePoint Designer workflow one can use 'CAML in REST' approach. OData will work too, just don't use both at the same time
Другие советы
When you use the action"Create list item" in your workflow, a variable named create appears in the action. The action also has the output clause which is denoted by (Output to Variable: create).
At the workflow's run time, the variable create stores the list item ID of the item that is created in the other list.
So you can use the variable :create to update the column in the listA:
Не связан с sharepoint.stackexchange