Hi,
I need to create a Flow but the first approver depends on the department selected in Forms. Then, the next 3 approvers are always the same so:
Department 1 | Department 2 | Department 3 |
Person 2 | Person 2 | Person 2 |
Person 3 | Person 3 | Person 3 |
Person 4 | Person 4 | Person 4 |
Is it possible to do like branches with conditions and send 1st approval depends on the department and then go back to one branch and continue the Flow to Person 2, 3, 4 doesn't matter what department was selected previously.
I don't want to duplicate the Flow under each IF statement as it will be the same for all routes.
Thank you for any suggestions.
Slawek
Solved! Go to Solution.
I would do this by creating a variable to hold the email address for the department approval. Then use a switch statement to set that value. After you exit the switch you can use the variable to complete the approval.
I would do this by creating a variable to hold the email address for the department approval. Then use a switch statement to set that value. After you exit the switch you can use the variable to complete the approval.
Hi @TheSlawekG ,
You could refer to screenshot below to create the flow:
Best Regards,
Alice
Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Pstork1 wrote:I would do this by creating a variable to hold the email address for the department approval. Then use a switch statement to set that value. After you exit the switch you can use the variable to complete the approval.
This would be the best solution
Then you just need to have 4 approvals loop after each other (and condition to go from one level to the other would be "if outcome is equal to approve")
If you're organisation is set up in O365, you could also use the Office Block with the action "get manager" from the one who triggered the flow
Thank you @Pstork1
I like the solution, never been used Switch before but together with a variable it's excellent!
Thanks.
Slawek
Switch() is just like an IF() in many ways, but allows for more choices than two.
My Flow starts when a new response is submitted and a document can be uploaded with the Form.
I parse the JSON of the field with upload and store the name of the file attached and its URL.
However, when there is no file uploaded the Parse JSON block fails.
The error is:
Unable to process template language expressions in action 'Parse_JSON' inputs at line '1' and column '63206': 'Required property 'content' expects a value but got null. Path ''.'.
I set something like this below to check if a file was uploaded:
But now I don't want to repeat the same flow (4 approvals) for YES and NO.
The ideal would be to use Switch but I tried with variables and it doesn't work.
Any ideas?
Thanks
Slawek
what is inside your Parse JSON block ?
your blocks should look like :
Parse JSON (from Form's file)
use this template :
{
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"link": {
"type": "string"
},
"id": {
"type": "string"
},
"type": {},
"size": {
"type": "integer"
},
"referenceId": {
"type": "string"
},
"driveId": {
"type": "string"
},
"status": {
"type": "integer"
},
"uploadSessionUrl": {}
},
"required": [
"name",
"link",
"id",
"type",
"size",
"referenceId",
"driveId",
"status",
"uploadSessionUrl"
]
}
}
Then
For Each
Get File (One Drive Block)
Add file to an element (Sharepoint block)
Details in last blocks :
Did you try to run your Flow without uploading/attaching a file to the Form?
I just tried to implement your approach into my Flow and I get the same error.
Send the Form without File.
Thank you for your effort and suggestion.
Slawek
You need an IF condition before the PARSE JSON steps
you should have "get form answers details"
from this, you have to use length( the question where you store file) and check if it's > 0
Join digitally, March 2โ4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.
User | Count |
---|---|
90 | |
57 | |
40 | |
39 | |
35 |
User | Count |
---|---|
80 | |
66 | |
57 | |
52 | |
43 |