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 / Pass the Selected Atta...
Power Apps
Answered

Pass the Selected Attachments File name to a gallery

(0) ShareShare
ReportReport
Posted on by 559

Hi All,

 

I have a form where attachments data card is there which have two files. The Onremovefile code is:

ClearCollect(CollectRemoveFiles,ThisItem.Attachments);

If any one file is selected to remove from the attachment data card I need to pass the file name to a gallery which triggers a flow to delete the specific file from SharePoint.

The items of the gallery is CollectRemoveFiles. I have a label in gallery Where I gave ThisItem.IsSeleted.

for example. If the selected file name is Pdf(1)(which is a 2nd file in the data card) and  in the gallery the IsSelected label is false even though I selected the file. Only the first item in gallery is true always even though it is not selected.

Any help/Suggestion on this.

Screenshot (67)_1.png
Screenshot (66)_1.png
Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,974 Moderator on at

    Hi,

     

    If I can ask.

     

    Can you simply leverage the out of box option of Clicking the X next to the attachment IN the form and then doing a SubmitForm(MyForm)?

     

    So that you only remove the one?

    FLMike_1-1695656484930.png

     

    Click the X on Fed

    My BIO

    FLMike_2-1695656507474.png

     

    Button with SubmitForm(Form3)

    FLMike_3-1695656521386.png

    It only removed the one I clicked the X for

    FLMike_4-1695656545687.png


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

     

     

  • Sri Profile Picture
    559 on at

    @FLMike 

    I cannot use submit form. Few of my fields in the form are multi selection fields so I'm using patch to save the values into the SharePoint. So file adding also I'm using flow only.

  • Michael E. Gernaey Profile Picture
    53,974 Moderator on at

    Hi,

     

    Lets chat on that. I have plenty of forms, including the one I have the attachments that have multi-select choices etc.

     

    It works fine.

     

    Can you tell what issue you run into when using the Form? So we can possibly get passed that.
    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • Sri Profile Picture
    559 on at

    @FLMike

    The error I got is Network error when using patch function. Even though I don't use Patch function. I still get this error when trying to submit form.

  • Verified answer
    Michael E. Gernaey Profile Picture
    53,974 Moderator on at

    I would say, lets try to resolve that because its the proper way to do it.

     

    If you dont mind these steps are super easy and should tell us how to solve the form problem.

     

    Step 1. Close your App (stop it running)
    Step 2. Click the Stethoscope in the Top Right
    Step 3. On the bottom click Open Monitor
    Step 4. Once Monitor is running go back and run your app
    Step 5. Cause your issue to happen
    Step 6. Close the app
    Step 7. Go to the Monitor and Filter (top right) based on the word Error

    Step 8. Go to the Response Tab and click on the > for the Body, it should tell us exactly what the error is so we can fix it and you wont need to do anything goofy.

     


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • Sri Profile Picture
    559 on at

    @FLMike 

    I tried the same way to check the error. But in monitor also it show the error message as network error occurred using patch function. I couldn't find more details on the error.

  • Sri Profile Picture
    559 on at

    I checked with monitor again and corrected the error. Thank you and its working.

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 602

#2
WarrenBelz Profile Picture

WarrenBelz 473 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 310

Last 30 days Overall leaderboard