I am in the process of building a flow for a team that I work with. Right now, it is set up to trigger on completion of a form in MS Forms to send out an approval and then contingent on the approval, an email to a final party. The email needs to contain attachments from the form and I've got that all figured out to where it works as intended. However, I built it based on the initial assumption that the form would always have an attachment or multiple attachments. After testing it wider with the rest of the team, scenarios popped up in which no attachments would be necessary on the form. When no attachments are present, it then breaks the flow. I am looking for the easiest way to have the flow check for attachments and move on when there aren't any or put them in my array when there are and ideally not have to build two completely separate lines down the flow if that's even possible. FYI - I'm super new to Power Automate (this is the second flow I've built), nor am I any level of programmer or developer, so any help is appreciated.
Solved! Go to Solution.
@AMarple Make a new condition where you select the attachment column is equal to and leave it blank.
Replace the first one with your field/column that contains the attachment from the form.
@JimmyWork - thanks for the tip. Tried that by adding the condition before the Parse JSON step in the flow above. Then tried to build the the Parse JSON, Initialize Variable and Apply to Each loop from the "If no" side of the control, but got stopped as it wouldn't let me put the Initialize Variable step in there. If I leave those after the control step, it still breaks the flow when there's no attachments. Is the only way to make this work to build the rest of the flow that doesn't include the variable under the "If yes" option for the control, terminate it at the end of that run, then allow the rest of the flow to continue as I've built it after the control to separate the with/without attachments?