Forum Discussion

JohnChu's avatar
JohnChu
Copper Contributor
Feb 10, 2022

Unable to "Set content approval status" when flow starts with "For a selected file"

I created 2 approval workflows. The first workflow starts with "When an item or a file is modified" and the second workflow starts with "For a selected file". For the exception of the starting point, the actions that follows are the same for both workflows. The first workflow runs to completion. The second one, however, fails when setting the content approval status. After a fair amount of troubleshooting, the problem stems from the fact that the originally selected file identifier isn't available in the second workflow. I tried adding "Get file property" and "Get file metadata" actions to no avail. As it turns out, the only dynamic content option for Id in "Set content approval status" action is the ID from the "For a selected file" action, which isn't the File Identifier required when setting the content status. Any help is appreciated. Thanks!

  • JohnChu's avatar
    JohnChu
    Copper Contributor

    RESOLVED! In the Dynamic Content selector, the correct field to use is the ID rather than the Identifier. The ID resolves to an integer value, while the Identifier resolves to a relative path to the Library. For a new workflow user, it's really confusing when to use what field as they all point to some type of id.

  • JohnChu's avatar
    JohnChu
    Copper Contributor
    One more thing, when setting the content approval status, it must go in a specific order. The document starts as ‘Draft’. Once it’s submitted for approval, it’ll go into ‘Pending’ status. From there it can be ‘Approved’ or ‘Rejected’. You can’t skip the order. If document is in ‘Draft’, you can’t approve nor reject it directly. It must be in the ‘Pending’ status before that.

    Why do I mention this? That's because if you start with the action "When an item or a file is modified", then the file is automatically set as "Pending" when submitted for approval. However, if you start with "For a selected file" the file stays as "Draft", in which case you need to add an extra step to set the content approval to "Submit" then set its final approval status in later steps. Otherwise, you'll get a misleading BadGateway error.

Resources