cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Scotty182002
Frequent Visitor

Help with Form condition if no attachment is present

Hi,

I'm working on a flow that will create a SharePoint list item from a Forms survey. I've got the initial flow created and it creates a list item, then copies any attachment that was made to the form from my onedrive then deletes the file from my onedrive at the end.

I'm having an issue though as if the form is submitted without any attachment(since its optional) the flow fails. I tried adding a yes/no condition where if form attachment = null, but that fails

 

The error I'm seeing:

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Scotty182002 ,

 

It looks like the condition isn't able to recognize that the Attachment field left blank is a null value. I am not sure why, but I figured out a simple workaround you can use.

 

Create a required question before the attachment upload option in your form called something like 'Upload attachment?' with choice answers 'Yes' and 'No'. Then, click the 3 dots in the top right next to share and select 'Branching'. Select the 'Upload attachment?' question and for 'Yes' choose to go to the attachment upload field, and for no, choose to go to the end of the form.

Capture.JPG

Then in your Flow, set the condition to be the 'Upload attachment?' dynamic content 'is equal to' and then just type Yes in the box with no quotations.

Capture.JPG

View solution in original post

8 REPLIES 8
Scotty182002
Frequent Visitor

Post is being weird with pictures...
Here is my setup and error:

flow setup1.png

flow error 1.png

rocamp
Community Support
Community Support

Hi @Scotty182002 ,

 

Can you show me screenshots of what you're doing under the if no in the Parse and Apply to each actions?

Hi @rocamp,

So the assumption is that if the attachment field is blank, do nothing. If it contains information, then parse the json and grab the attachment to attach to the sharepoint list item.

Flow setup2.png

Hi @Scotty182002 ,

 

It looks like the condition isn't able to recognize that the Attachment field left blank is a null value. I am not sure why, but I figured out a simple workaround you can use.

 

Create a required question before the attachment upload option in your form called something like 'Upload attachment?' with choice answers 'Yes' and 'No'. Then, click the 3 dots in the top right next to share and select 'Branching'. Select the 'Upload attachment?' question and for 'Yes' choose to go to the attachment upload field, and for no, choose to go to the end of the form.

Capture.JPG

Then in your Flow, set the condition to be the 'Upload attachment?' dynamic content 'is equal to' and then just type Yes in the box with no quotations.

Capture.JPG

@rocamp , you rock!

That workaround did the trick. Glad I wasn't crazy about the null value before. Appreciate the help, this community is awesome.

Finnair
Resolver I
Resolver I

This could have been done without branching leaving in the original condition "Choose a value" field completely empty.

Tested and worked.

Finnair_0-1626334247089.png

 

Brilliant. Thx!

clacardo2022
New Member

I was able to figure out how to do it without attachment but I am running into the issue of a common condition, with or without attachment. Condition for approval or rejection, I am adding to a SharePoint list. The error is within the approval process where it includes the attachment field and the SharePoint list does as well. Those fields will be null as well. what would you do?

 

467f7664-12fc-47e1-a353-a6c91856c487.png

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,962)