cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
marsyazahid72
Helper I
Helper I

Cannot Update 'Attachments' in gallery

I have a gallery that displays items from the SharePoint list. In the gallery, I have added an attachment data card in the gallery to enable the user to download the attachment. However, when I try to update the attachment, the attachment is unable to update in the gallery itself and the SharePoint list.

 

so here the interface:

marsyazahid72_0-1614352922054.png

 

then, this is the coding for update button;

 

Set(
    varPA,
    View
);
ForAll(
    GalleryEdit.AllItems,
    UpdateIf(
        Stud_EC_PA,
        'ID_PA #' = Value(TextInput14.Text),
        {
            EC_PA_Name: TextInput6_8.Text,
            EC_PA_Level: TextInput6_11.Text,
            EC_PA_Cat: TextInput6_9.Text,
            EC_PA_Pos: TextInput4.Text,
            EC_PA_Cri: TextInput6_10.Text,
            Attachments: Attachments
        }
    )
)

 

 

Anyone who can help me to solve this problem?

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@marsyazahid72 

Here are your obstacles:

1) In PowerApps currently, you can Only change attachments directly by utilizing a Form with an attachments control in it and then by using the SubmitForm action on the form.

2) You cannot put a Form in a Gallery, so you cannot do the above row by row.

3) As mentioned in #1, the form is the only option for attachment changes - so Patch, Update/IF, etc. will not change the attachments.

 

If you need this type of functionality, you will need to look at your design and consider alterations, or employ PowerAutomate to submit the attachments to a flow and have flow then alter the attachments of the record (certainly more work to achieve this).

 

I hope this is helpful for you.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

1 REPLY 1
RandyHayes
Super User
Super User

@marsyazahid72 

Here are your obstacles:

1) In PowerApps currently, you can Only change attachments directly by utilizing a Form with an attachments control in it and then by using the SubmitForm action on the form.

2) You cannot put a Form in a Gallery, so you cannot do the above row by row.

3) As mentioned in #1, the form is the only option for attachment changes - so Patch, Update/IF, etc. will not change the attachments.

 

If you need this type of functionality, you will need to look at your design and consider alterations, or employ PowerAutomate to submit the attachments to a flow and have flow then alter the attachments of the record (certainly more work to achieve this).

 

I hope this is helpful for you.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (3,137)