cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Super User III
Super User III

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
Super User III
Super User III

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

Perfect, thank you very much! 


J.

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (4,485)