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

Re: Conditional Action to Attach File to Sharepoint List Item

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!





View solution in original post

2 REPLIES 2
Super User
Super User

Re: Conditional Action to Attach File to Sharepoint List Item

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!





View solution in original post

JamesFox
Frequent Visitor

Re: Conditional Action to Attach File to Sharepoint List Item

Perfect, thank you very much! 


J.

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (6,974)