How to fetch the comments of associated workflow with the document/file on sharepoint

Pratik, Uddeshya 26 Reputation points
2020-08-24T13:52:41.52+00:00

Hi Team,

I am looking for the API, that returns the entire workflow metadata associated with a document

Currently, I am using the below API, that returns the associated workflow with status but the comments is missing in the response.

api/Web/Lists(guid'6f970319-5211-4a7f-a66d-d2b7da0fadce')/Items(256)/FieldValuesAsText

Please find the attached screenshots for the reference.

I have rejected the document with a comment, but it's not coming in the response.
I want to retrieve that comment as well.

Best Regards,
Uddeshya Pratik
19860-1.png19908-2.png

Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Baker Kong-MSFT 3,801 Reputation points
    2020-08-25T04:53:29.833+00:00

    Hi PratikUddeshya-7348,

    'Approval Status' and 'Approver Comments' come from the built-in feature 'Content approval', you can enable it in 'versioning setting'

    20007-image.png

    And its comments stores in the field 'OData__ModerationComments' :

    19999-image.png

    Check https://www.c-sharpcorner.com/blogs/getting-approval-status-and-comments-in-flow

    And there is an approval workflow :

    20056-image.png

    20044-image.png

    It will add a 'xxxworkflow status' column into the list. But note that this is a different feature.

    And its comments store in taks item:

    19960-image.png

    20094-image.png

    So you can retrevel it in the task list (the list that is assoicated with the workflow) , and you can filter the task item by WorkflowItemId/WorkflowListId (or other fields).

    More Reference:

    Best Regards,
    Baker Kong


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.