web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / What if there is or is...
Power Apps
Answered

What if there is or is no attachment? How to build a flow?

(0) ShareShare
ReportReport
Posted on by 18

Hello everyone,

 

I made an application in which certain data are entered, which are then saved on a SP list. One of these data is an attachment. An attachment may or may not be added, because sometimes there is no need for it.

 

Adding attachments through flow works fine for me. But I have a problem when the attachment is not placed? What to do then?

 

I'm not sure if it's enough to add something to the code or do I have to do something in the flow? If I have to do something in flow, can someone tell me exactly what? 🙂

 

The APP

APP.png

 

The code on the "Zavrsi" button which is conneted to my flow

CODE.png

 

The flow

flow.png

 

Categories:
I have the same question (0)
  • Sundeep_Malik Profile Picture
    6,501 on at

    Hey @dea4e 

     

    What error you are getting if attachment is empty?

     

    You can try two things, check before if attachment is available, if it is, use add attachment otherwise dont add attachment. 

  • dea4e Profile Picture
    18 on at

    Hi @Sundeep_Malik 

     

    than you, are you thinking of something like this?

     

    If so, can you help me with the lower one? I don't know what to write in these fields, and whether the condition "Has Attachment - is equal to - expression true" is set correctly.

     

    Additionally, what should I put under "apply to each" because I want it to apply to multiple attachments that someone can put in?

    Condition.png

  • Sundeep_Malik Profile Picture
    6,501 on at

    Hey @dea4e 

     

    You should pass the field that contains attachment. Not really sure. Probably use a field called Attachments. 

    Though just be careful, You are using get file content of one drive, you should be using get file content of sharepoint. 

  • dea4e Profile Picture
    18 on at

    @Sundeep_Malik 

     

    I think I understand what the problem is. Flow is ok, if there is an attachment, add it, but if there is none, then the app displays an error:

    greška.png

    I need to add something to Run. to let him know that the attachment doesn't have to be, do you know how to achieve that?

     

    kod.png

  • Sundeep_Malik Profile Picture
    6,501 on at
  • Verified answer
    dea4e Profile Picture
    18 on at

     

    @Sundeep_Malik 

    Solved it by adding in PowerApps If(IsEmpty(Attachement),do this, do this (if its not empty) 😊

     

    kod.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 742

#2
Valantis Profile Picture

Valantis 474

#3
Haque Profile Picture

Haque 358

Last 30 days Overall leaderboard