Forum Discussion
Nested IF Expressions within Flow
Hi. I am trying to use nested IF expressions to populate a Word template with Flow. Although the expression is accepted and the flow reports that it has run successfully, the template is not populated correctly. An example is below (sorry it's huge...):
If all the responses are No when completing the Form, it will only populate the template with the first statement ("All staff have completed the mandatory eLearning modules within the last year for the destination in which they are based."), ignoring the remaining "nested" conditions.
Can anyone assist, please?
Many thanks.
- Damien_RosarioSilver Contributor
Hi Matt Bryant
Hope you are well.
I'm having a squiz at your expression and the logic doesn't quite make sense to me (there may be things in your flow that you haven't shown or described here so I will make some assumptions).
If the first answer to the question is No then it will print "All staff have completed the mandatory eLearning modules within the last year for the destination in which they are based" and stop there and ignore the other conditions.
The first part of the expression is only checking one question, so how will know that all four questions are answered to meet this condition?
The same applies if you make it to question two and the answer is No and so forth.
Are you looking to to check against all questions and execute the IF statements to vet each answer, or do you want to stop when a condition is met?
If you could please outline your logic, it would help figure out what's happening.
Cheers
Damien
- Matt BryantCopper Contributor
Hi Damien_Rosario - thanks for getting back so quickly.
For a bit of background, I am creating a compliance self-assessment for our various offices to complete. The final page of the document that is produced lists any high-priority concerns from each section of the assessment. Where none of these concerns are identified, I would like to say "No concerns identified" or similar, rather than just leaving the section blank.
The formula I have written is based on Excel, but it is clearly not quite right for Flow!
Matt.
- Damien_RosarioSilver Contributor
Hi Matt Bryant
Blah so my entire post failed to upload so I'm doing this again.
I'm still not quite clear on your set up, are you using a single field in your doc to display the result from your IF statement, or are you looking to have each questions result in the doc?
Also in case you want further options and other opinions, you can try the experts at https://powerusers.microsoft.com/t5/PowerApps-Community/ct-p/PowerApps1. These guys are insanely amazing.
I'm happy to help explore what to do but I will need more info as it's tough to diagnose something without knowing what outputs you want in the last page of the doc.
Best wishes for the weekend ahead
Damien
- Damien_RosarioSilver Contributor
Hi again Matt Bryant
As an additional post to my earlier response and on an assumption, have you tried using Condition to break down your requirements in a user friendly way?
If you needed to vet the combos (e.g. all No, 3 No and 1 Yes, 2 No and 2 Yes, etc) then using nested conditions gives you a GUI to set your conditions by and to then execute that particular result you are seeking.
Hope that helps in some way?
Cheers
Damien