سؤال

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:

https://social.technet.microsoft.com/Forums/office/en-US/01f56d99-7b66-41d8-9e32-301ff4dddf66/get-newly-created-list-item-id-from-within-a-workflow?forum=sharepointgeneralprevious

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى sharepoint.stackexchange
scroll top