How-to get the unique ID of an SharePoint Online list item when creating one - #ARCHIVED#

This content has been archived. It may no longer be relevant.  

For certain solutions, it is needed to know the unique ID of the SharePoint Online list item which has been created. The way to get it depends on how the item was created.

The function Patch returns a record when creating an item. When assigning this record to a collection, functions can be used to substract the ID:

            {Title: "Example"}

The ID is substracted via: First(newItem).ID

When using an edit form, the ID is available in the property “OnSuccess” of the form control via: 'Form'.LastSubmit.ID where ‘Form’ is the name of the edit form.

This function can be used to add an item but cannot be used to get the ID. No useful/consistent data is returned from which the unique ID could be substracted.