Skip to main content
Community site session details

Community site session details

Session Id : v8QeQIZdVeu5YHrU5OAHDo
Power Apps - Building Power Apps
Answered

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

Like (0) ShareShare
ReportReport
Posted on 23 Nov 2022 09:49:58 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

 

  • Verified answer
    dea4e Profile Picture
    18 on 23 Nov 2022 at 14:27:03
    Re: What if there is or is no attachment? How to build a flow?

     

    @Sundeep_Malik 

    Solved it by adding in PowerApps If(IsEmpty(Attachement),do this, do this (if its not empty) ๐Ÿ˜Š

     

    kod.png

  • Sundeep_Malik Profile Picture
    6,482 on 23 Nov 2022 at 13:02:54
    Re: What if there is or is no attachment? How to build a flow?

    @dea4e 

     

    Not really sure what you can change in Power apps for this, but check out the following posts, might help:

     

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Empty-Attachments/td-p/179806

    https://powerusers.microsoft.com/t5/Building-Power-Apps/PowerApps-attachment-control-how-to-check-if-any-attachments/td-p/238119

  • dea4e Profile Picture
    18 on 23 Nov 2022 at 12:57:43
    Re: What if there is or is no attachment? How to build a flow?

    @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,482 on 23 Nov 2022 at 11:50:14
    Re: What if there is or is no attachment? How to build a flow?

    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 23 Nov 2022 at 10:49:36
    Re: What if there is or is no attachment? How to build a flow?

    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,482 on 23 Nov 2022 at 10:12:55
    Re: What if there is or is no attachment? How to build a flow?

    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. 

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful forโ€ฆ

Paul Stork โ€“ Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Communityโ€ฆ

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete