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

Conditional Action to Attach File to Sharepoint List Item

Hi all,

 

I'm trying to create a Flow that captures input from a Form and inserts the data into a SharePoint List. I'd like to be able to upload files via the Form and then once some other actions take place (mostly sending confirmation emails to responder and others) the Flow attaches the files to the List item.

The flow I have put together works, and the uploads are attached successfully to the list item, but if there is nothing uploaded via Forms the Flow fails. It performs the function it is designed for as the attachment Actions are last, but I would like to iron out the problem.

 

Here is a screenshot of the relevant part of the Flow:

 

flow.png

 

I would like the Get File Content and Add Attachment 2 Actions to only take place if there is a file uploaded, but I cannot seem to set Condition 2 correctly. I believe the Value needs to be connected to the relevant Form question using dynamic content, but I can't seem to get the logic right.

Any guidance would be gratefully received!

Thanks,

 

James.

1 ACCEPTED SOLUTION

Accepted Solutions
Jcook
Super User
Super User

Hello,
Can you try to use this in your IF condition.
Use the expression:
empty() is equal to false

Inside the () put your dynamic content of the question that is asking for the attachments.
For false. I always use a expression called false.
Note you can also use the expression true.

The expression empty() returns true if the result is empty.

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others

Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





View solution in original post

2 REPLIES 2
Jcook
Super User
Super User

Hello,
Can you try to use this in your IF condition.
Use the expression:
empty() is equal to false

Inside the () put your dynamic content of the question that is asking for the attachments.
For false. I always use a expression called false.
Note you can also use the expression true.

The expression empty() returns true if the result is empty.

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others

Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





JamesFox
Frequent Visitor

Perfect, thank you very much! 


J.

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.

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.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (3,046)