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





View solution in original post

JamesFox
Frequent Visitor

Perfect, thank you very much! 


J.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

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

Top Solution Authors
Users online (2,220)