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

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
v-siky-msft
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
TurboTape
Resolver I
Resolver I

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 🙂

IMathur
Helper V
Helper V

Hello All, 

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

v-siky-msft
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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

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.

Users online (1,256)