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 / Unable to update field...
Power Apps
Unanswered

Unable to update field of a gallery

(0) ShareShare
ReportReport
Posted on by 8

Hi,

I want to allow users to modify and save a text box inside a gallery in my app.

I add a Button and set the onselect property to:

Sephirot2000MU_0-1603888094662.png

When I perform a change in the textbox and press the button it show me this error.

Error in [GalleryName]. To add elements to the docs library use SPFileCollection.Add().

I try to use Collect(PLANOS_MONTAJE_A;{PASOS: TextInput1.Text}) but does not work.

Any help?

Thanks in advance.

 

Operation not valid.

Error in [LibraryName]. To add element to the docs library use SPFileCollection.Add()

I try to use Collect(PLANOS_MONTAJE_A;{PASOS: TextInput1.Text}) instead but despite the error does not shows, doesn´t work.

What can I do?

Thanks in advance.

Categories:
  • RishabBehl31 Profile Picture
    180 on at

    Hey @Sephirot2000MU ,

     

    I think the problem is with the syntax. 

    You're using this : Collect(PLANOS_MONTAJE_A;{PASOS: TextInput1.Text})

     

    Replace ";" by "," after collection name.

    Use : Collect(PLANOS_MONTAJE_A , {PASOS: TextInput1.Text})

     

    I think it is considering this whole thing as collection (datasource) name "PLANOS_MONTAJE_A;{PASOS: TextInput1.Text}". That is why it is showing "Error in [GalleryName]".

     

    I hope this simplifies your query if any more question let me know.

     

    Warmly

    ----------------------------------------------------------------------------------------------------------------

    Thanks for taking my inputs. If you're digging into it, a Thumbs up is appreciated! Or if my suggestion solved your issue, please Accept it as a solution. This way everyone would be able to get the solution if they face a similar problem

  • Sephirot2000MU Profile Picture
    8 on at

    Thanks but does not work.

    The error message doesn´t show but the field reload with the original content.

    Here I delete the content of the box

    Sephirot2000MU_0-1603891979502.png

    Now I press the button to update and the original content returns to the field.

    Sephirot2000MU_1-1603892056664.png

     

     

  • RishabBehl31 Profile Picture
    180 on at

    Hey @Sephirot2000MU ,

     

    After applying patch or update function. Try refreshing the collection or data source (Syntax: Refresh(DataSourceName)) may be data is updated at back-end and not updated here.

     

    If it's not the case then check your update function if data is getting updated or not. I mean is it setting original value to "" instead of existing value.

     

    Warmly

     

    Rishab

  • Sephirot2000MU Profile Picture
    8 on at

    Hi again.

    Where I must put the Refresh(DataSourceName)?

  • RishabBehl31 Profile Picture
    180 on at

    Hey @Sephirot2000MU ,

     

    After you've applied patch function or any update function on the On Select property of the button you're using to save/update the record.

     

    Syntax: Patch(Something, Something, ... ); Refresh(DataSourceName)

     

    Warmly,

     

    Rishab

  • Sephirot2000MU Profile Picture
    8 on at

    Hi again.

    Same error. My button has this on the property.

     

    Collect(PLANOS_MONTAJE_A; {PASOS: TextInput1.Text};Patch(PLANOS_MONTAJE_A;{PASOS:TextInput1.Text}) ;Refresh(PLANOS_MONTAJE_A))

  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    @Sephirot2000MU ,

    You have to tell Power Apps which record to Patch. The below is an example using the List ID (you would have to refer to it where I have YourSelectedID.

    Patch(
     PLANOS_MONTAJE_A;
     {ID:YourSelectedID};
     {PASOS:TextInput1.Text}
    );
    Refresh(PLANOS_MONTAJE_A)

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    Hi @Sephirot2000MU ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 339 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 289

#3
Mohsin Ali Profile Picture

Mohsin Ali 228

Last 30 days Overall leaderboard