cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate III
Advocate III

Reading Approval Status

Hi All,

This is not a question, but a solution to a problem I have had: Reading the Approval Status. There are a few guides to getting this to work, but I kept running into problems, so I swore that I would write a guide here, when I finally found something that worked for me.

Problem: You want your Flow to be able to read the built-in Approval Status column, that is not available for Flow.

Solution:

I will go though each action an explain. The solution is a two-step solution, as we need to get som info out midway, that we need to configure an action later in the flow.

1.

First we make a call to the SharePoint list and get the Status.

image.png

Uri: _api/web/lists/GetByTitle('Documents')/items(<ID of element>})?$select=OData__ModerationStatus

Headers:

Accept                application/json; odata=verbose

Content-Type     application/json; odata=verbose

Body: body('Send_an_HTTP_request_to_SharePoint' )['OData__ModerationStatus']

(I have to admit, that I really don't know what I'm doing in the Body section)

 

2.

This step might be skipable, and you can just use the code from step 3.

Send the result of HTTP request action to your e-mail. This send e-mail action is only temporary and will be deleted later.

image.png

Body: Concat function is this: concat(body('Send_an_HTTP_request_to_SharePoint'))

 

3.

Run the flow on an item in your document library and recieve the e-mail. The data should look something like this:

{"d":{"__metadata":{"id":"e6ad8e94-985d-4eb3-93c7-ff233a277874","uri":"https://XXX.sharepoint.com/sites/YYY/_api/Web/GetByTitle('Documents')/Items(7)","etag":"\"6\"","type":"SP.Data.Shared_x0020_DocumentsItem"},"OData__ModerationStatus":2}}

Copy all of this, as it is needed soon.

 

 

4.

Delete the Send an email action - we don't need it anymore.

 

5.

Insert the Parse JSON action, so we can convert the recieved data to something usefull.

image.png

Insert the Body from the HTTP Request.

Now, press the "Use sample payload to generate schema" in the buttom of the Parse JSON action.

Indsert the data you got in your e-mail:

image.png

Press Done and the result will show itself in the former window:

image.png

 

6.

Done!

You can now insert the ID of the Approver Status into your flow:

image.png

 

7.

Bonus

If you have trouple using the format of the data in your actions, you can convert it with the Compose Action.

image.png

Insert the variable - and have "" around it.

 

Let me know if you have any problems with this.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @BlueCar,

 

Thank you for your sharing.

It is a smart solution and I believe many people would benifit from it.

 

Best regards,

Alice

View solution in original post

7 REPLIES 7
Community Support
Community Support

Hi @BlueCar,

 

Thank you for your sharing.

It is a smart solution and I believe many people would benifit from it.

 

Best regards,

Alice

View solution in original post

Helper III
Helper III

Hello,

 

Thanks for posting this. Looks like something i can use to troubleshoot. But can you please share the complete workflow?

 

I also had issue with configuring Uri as the Output value is not clear? How did you get it?

 

Thanks,


Santosh

Frequent Visitor

Nice post.  Thanks for sharing.  I am working with document sets in a document library with Sharepoint content approval enabled.  I face the same issue.  Does your solution work for items in document library?  I tried but I think /_api/web/....

 

Thanks.

Hi @BlueCar 

Is it possible to post your entire FLOW and expand each step if possible please?

 

Thanks

I am getting this message: "A potentially dangerous Request.Path value was detected from the client (&lt;)."  It then lists the clientrequestID and the servicerequestID.  I've checked everything over several times and the only thing I see different is that you have the purple "output" indicator on your Uri  line while I only have what in indicated in your text as text - <ID of element>.

 

Thank you. 

Hi @bpmpower@Santosh_M and @CindyZ 

I don't have that flow anymore, but what I have posted is what was in the flow. I'm busy at the moment, so I don't have time to create a new sample flow.

The solution was created to handle approvals of documents in a documentlibrary.

Sorry about the missing explaination of the "output" value in the first screenshot. It was simply the ID of the item being processed e.g. "104".

Thank you for the reply. 

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (43,397)