Hi guys,
A would like to create Approval Process(Wait for one response), so when i add Start and Wait approval Step, then use, for example, comments, my flow automatically add apply for each Response. How to build process with comments without this Apply for each?
In the Past i created another Approval Process and now I'm using them without any problems.
Thanks a lot
The number of approvers is based on what you submitted to the approval. If you used an array then its the length of the array. If you used a semicolon delimited list you either need to know or need to Split() the list on semicolons and then do the length of the array.
Whatever index you use will return either the comments, the approver's name, etc. depending on which field you ask for.
In terms of the syntax, its close, its not exact since I didn't have an example in front of me. I'll try to pull up an old copy and put the syntax example here. But any example is going to be dependent on the names and actions I used. Yours may differ. The syntax is correct, but may not match the name.
How do i know which row in the array i am pulling?
And when i used this formula in the expression i was told the expression is invalid.
Which value would include the # of approvers or the # of approver's comments i want to grab?
Thank you
If you know how many approvers you have when you are writing the Flow then you can access the Responses Array using an index in JSON. I don't have a specific example in front of me, but it would be something like this.
body('Responses')?['value'][integer]?['Comments']
What if there are 3 levels of approvals? I was able to update a spreadsheet row with the comments from the 1st approver, but when i try to do so with the 2nd, it always gives me the comments of all approvers (array) ("Responses") instead of being able to choose the same "Response".
How can i get the 2nd level approvers comments without having to use apply each?
Approver 1:
Approver 2:
I want approver 1 and their comments, and then approver 2 and his comments only.
Thanks for your help!
Ok, I got it,
I have initialized variable for every comment. But its don't good when i need to develop big process, it needs to create a lot of variables.
The problem is that the Approval action returns the responses in a collection, even if there is only one response. That's why you get an apply to each. If you are only sending out the approval to one person then you can manually code the values you are using from the response in JSON using the First() function. That will give you the First reply, comment, or whatever you specify. It works, but it requires inputting the raw json in the formula bar so its not easy for average people. You can also key of the Outcome object, which returns the overall status, but then you won't have access to any of the comments etc.
WarrenBelz
146,645
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional