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

%3CLINGO-SUB%20id%3D%22%5C%26quot%3Blingo-sub-3151657%5C%26quot%3B%22%20slang%3D%22%5C%26quot%3Ben-US%5C%26quot%3B%22%3EUnable%20to%20%22Set%20content%20approval%20status%22%20when%20flow%20starts%20with%20%22For%20a%20selected%20file%22%26lt%3B%5C%2Flingo-sub%26gt%3B%3CLINGO-BODY%20id%3D%22%5C%26quot%3Blingo-body-3151657%5C%26quot%3B%22%20slang%3D%22%5C%26quot%3Ben-US%5C%26quot%3B%22%3E%3CP%3EI%20created%202%20approval%20workflows.%20The%20first%20workflow%20starts%20with%20%22When%20an%20item%20or%20a%20file%20is%20modified%22%20and%20the%20second%20workflow%20starts%20with%20%22For%20a%20selected%20file%22.%20For%20the%20exception%20of%20the%20starting%20point%2C%20the%20actions%20that%20follows%20are%20the%20same%20for%20both%20workflows.%20The%20first%20workflow%20runs%20to%20completion.%20The%20second%20one%2C%20however%2C%20fails%20when%20setting%20the%20content%20approval%20status.%26nbsp%3BAfter%20a%20fair%20amount%20of%20troubleshooting%2C%20the%20problem%20stems%20from%20the%20fact%20that%20the%20originally%20selected%20file%20identifier%20isn't%20available%20in%20the%20second%20workflow.%20I%20tried%20adding%20%22Get%20file%20property%22%20and%20%22Get%20file%20metadata%22%20actions%20to%20no%20avail.%20As%20it%20turns%20out%2C%20the%20only%20dynamic%20content%20option%20for%20Id%20in%20%22Set%20content%20approval%20status%22%20action%20is%20the%20ID%20from%20the%20%22For%20a%20selected%20file%22%20action%2C%20which%20isn't%20the%20File%20Identifier%20required%20when%20setting%20the%20content%20status.%20Any%20help%20is%20appreciated.%20Thanks!%26lt%3B%5C%2FP%26gt%3B%26lt%3B%5C%2Flingo-body%26gt%3B%3CLINGO-LABS%20id%3D%22%5C%26quot%3Blingo-labs-3151657%5C%26quot%3B%22%20slang%3D%22%5C%26quot%3Ben-US%5C%26quot%3B%22%3E%3CLINGO-LABEL%3EMicrosoft%20Flow%26lt%3B%5C%2Flingo-label%26gt%3B%26lt%3B%5C%2Flingo-labs%26gt%3B%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3C%2FLINGO-SUB%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3151657%22%20slang%3D%22en-US%22%3EUnable%20to%20%22Set%20content%20approval%20status%22%20when%20flow%20starts%20with%20%22For%20a%20selected%20file%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3151657%22%20slang%3D%22en-US%22%3E%3CP%3EI%20created%202%20approval%20workflows.%20The%20first%20workflow%20starts%20with%20%22When%20an%20item%20or%20a%20file%20is%20modified%22%20and%20the%20second%20workflow%20starts%20with%20%22For%20a%20selected%20file%22.%20For%20the%20exception%20of%20the%20starting%20point%2C%20the%20actions%20that%20follows%20are%20the%20same%20for%20both%20workflows.%20The%20first%20workflow%20runs%20to%20completion.%20The%20second%20one%2C%20however%2C%20fails%20when%20setting%20the%20content%20approval%20status.%26nbsp%3BAfter%20a%20fair%20amount%20of%20troubleshooting%2C%20the%20problem%20stems%20from%20the%20fact%20that%20the%20originally%20selected%20file%20identifier%20isn't%20available%20in%20the%20second%20workflow.%20I%20tried%20adding%20%22Get%20file%20property%22%20and%20%22Get%20file%20metadata%22%20actions%20to%20no%20avail.%20As%20it%20turns%20out%2C%20the%20only%20dynamic%20content%20option%20for%20Id%20in%20%22Set%20content%20approval%20status%22%20action%20is%20the%20ID%20from%20the%20%22For%20a%20selected%20file%22%20action%2C%20which%20isn't%20the%20File%20Identifier%20required%20when%20setting%20the%20content%20status.%20Any%20help%20is%20appreciated.%20Thanks!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3151657%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Flow%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor

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!

2 Replies

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.

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.