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

Patch the label text in Gallery Items in SharePoint list column

Hi Experts,

I have a label in the gallery item and gives the value of true/false on the basis of certain values being only calculated in PowerApps. See the image below:

IMathur_0-1596786500553.png

Gallery is using sharepoint list as data source.

Now i want to assign this value of the respective label for each gallery item in the column 'ViewFilter'.

 

I want this action to happen at the start of the app.

 Below is that syntax that i am using in Onstart of App:

Patch(datasource, LookUp(source, ProjectStatus.Value= "Completed"), {ViewFilter: CProjects_Gallery1.Selected.Label31.Text})

But this formula is not giving any errors but not saving the true/false value of the label in the column.

Please help on 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @IMathur ,

 

This is a simple logic issue that you want to patch the CProjects_Gallery1.Selected.Label31.Text  to the ViewFilter column, but the Patch function is triggered at the start of app, before the gallery is selected, so nothing can be saved to SharePoint list.


The workaround is to Either hard-code the value into the Patch formula or adjust the trigger of the Patch formula.

Hope this helps.
Sik

View solution in original post

5 REPLIES 5
Helper II
Helper II

Hi IMathur

 

Is the field a true / false field in Sharepoint, in that case you need to feed it true false data (not text).

You han do it by using if statement (If label31.Text="Completed"; true ; false).

Ekstra free tip. If you dont get any errors, but things dont work as intended. Try this:

Create a gallery somewhere on the screen. Set the source to Errors(source). Add the items as text field inside the gallery. I think its 3 or 4 fields. Now you will get a list of errors that occure when you try to patch. Maybe this will help you find exactly what the problem is if the ture false thing at the top didnt work 🙂

 

Best Regards

Tommy

Hi @TurboTape

How to set the source as Errors(source)?

By source you mean, data source ?

I was a bit fast I see. 

 

If you have a source (ie. sharepointlist called Data). You put the following in Items in the Gallery:

Errors(Data)

In the gallery you set Labels for The 3 or 4 items you can choose from (something like this :ThisItem.Error, ThisItem.Code, ThisItem.Message)

 

If any errors occure when you working with this data source, they will show up in this gallery. 

 

I hope this was more clear 🙂

Helper IV
Helper IV

Hello All, 

Please Help on the issue, i am in urgent need of this!

Community Support
Community Support

Hi @IMathur ,

 

This is a simple logic issue that you want to patch the CProjects_Gallery1.Selected.Label31.Text  to the ViewFilter column, but the Patch function is triggered at the start of app, before the gallery is selected, so nothing can be saved to SharePoint list.


The workaround is to Either hard-code the value into the Patch formula or adjust the trigger of the Patch formula.

Hope this helps.
Sik

View solution in original post

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

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