Hello @nitika ,
I am developing a workflow for a document (Procedure, Manual, etc.) to be approved by several people. The flow was triggered manually when I select the document in a Sharepoint library. Image 1 Trigger Flow.
For approvals I use the "Star and wait for an approval" action, which triggers a mail flow where the person can approve or reject. Image 2 Star and wait for an approval.
The traceability of the approval flow I am taking through a Sharepoint list (I tried to create and configure the fields in the library and I could not, almost damaged the entire sharepoint site), and for this I use the “create item” action (Image 3 Create Item), with the Next information:
Name - File Name
User name - The display name of the user who triggered the flow
Responses Approver name - The name of the approver
Responses comments - Comments added by the approver
Outcome - The outcome of the approval
Completation Date - Date the approval was complete
When the item is created, an ID is automatically generated for the item in the sharepoint list, and that ID is what I want to use to update the item.
The flow continues into the next stage, which is reviewing the document by a second approver, and this is where I have the problem. When I use the action "Update item" (Image 4 Update item) in the second approver of the document, it throws the following error:
The inputs of template action "Update item" at line '1 and column 26811' is invalid. Action 'Apply_to_each' must be a parent 'foreach' scope of action 'Update item' to be referenced by 'repeatItems'or 'items' functions. Image 5 Update item error.
It is at this stage where the error is being presented, because I cannot get the ID of the item from the sharepoint list to update it. I think it may be because the action "Create item" is framed in another one that is "Apply to each", but I have not been able to find a way to extract that ID (Maybe it can be done with a formula) and include it in update item action.
Image 1 Trigger Flow
Image 2 Star and wait for an approval
Image 3 Create Item
Image 4 Update Item
Image 5 Update Item error