cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
IMathur
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
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 IV
Helper IV

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (30,139)