cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sephirot2000MU
New Member

Unable to update field of a gallery

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.

8 REPLIES 8
RishabBehl31
Resolver I
Resolver I

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

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

 

 

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

Hi again.

Where I must put the Refresh(DataSourceName)?

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

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))

@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.

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.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,062)