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

Gallery Items (Toggle Control)

Hello there,

 

I have gallery control(Filtered) and want to save some fields in the SharePoint list as Blank() when I am going to set Toggle as "off".

I did something like this in on uncheck property like below:
patch(data source,ThisItem,{fieldsname*:Blank()}); *more than 3 fields

 

Problem:

Filtered gallery item is more than 1

I can make null on the first item but am not able to write anything in 2nd item and if I am able to write then 1st item is going to null at that time.

 

Regards,

Manoj Roy

 

8 REPLIES 8
WarrenBelz
Super User
Super User

Hi @manojrohit16 ,

Try turning on Formula Level Error Management in Advanced settings if you are having difficulties patching blank values. I assume here you are patching to a Text field (not a yes/no feld)

 

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.

Visit my blog Practical Power Apps

Thank you for your message.

 

Can you please let me know how can I patch for the selected gallery item? I have already done for the selected gallery item code and it works perfectly but does not work on toggle off.

 

I tried for the selected gallery item like below

 

ThisItem,

Lookup

{ID=ThisItem.ID}

 

I tried all above for the selected gallery and also patch the toggle value as false with other textinput fields.

 

Please guide me where I am wrong.

 

Regards,

Manoj Roy

 

 

@manojrohit16 ,

I am not sure how that addresses what I posted - what type of field are you patching back to - or are you simply after Patch code?

Patch(
   data source,
   ThisItem,
   {
      fieldname1:Blank(),
      fieldname2:Blank(),
      fieldname3:Blank()
   }
)

 

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.

Visit my blog Practical Power Apps

I'm patching field gross(currency),Fees(currency),date(datetime),paid(Toggle) where I save toggle value as togglepaid.value

 

 

@manojrohit16 ,

Based on what I posted, have you attempted the code and does it work? Please supply your code (in Text) if not - I assume Toggle is a Yes/No field (if so, you cannot Patch Blank() to it as the value needs to be either true or false).

 

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.

Visit my blog Practical Power Apps

manojrohit16
Helper I
Helper I

The below code is for OnUncheck(When user toggle Off)

Patch(Listname,ThisItem,{Settlement:Blank(),Fees:Blank(),Paid:TogglePaid.Value,DatePaid:Blank()})

Togglepaid is Yes/No in checkbox in SharePoint list

Also, I read one of your thread in Community where you discussed the same issue:
https://powerusers.microsoft.com/t5/Building-Power-Apps/Gallery-Checkboxes-and-Toggles-Uncheck-Autom...

 

Also, after patching as below code, I'm getting errors like "Network Error when using patch function: conflicts exist with changes on the server, please reload " when toggling off for the 2nd item.

 

Regards,

Manoj

Hi @manojrohit16 ,

Apart from the minor suggestion below, there is nothing with your code

Patch(
   Listname,
   {ID:ThisItem.ID},
   {
      Settlement:Blank(),
      Fees:Blank(),
      Paid:TogglePaid.Value,
      DatePaid:Blank()
   }
)

It is a bit hard to tell anything from the screen shot you posted, but that message generally happens when you submit a form that has been updated elsewhere (in your app or by another user) since the Form was opened. Have you tried setting the Formula Level Error Management to true?

Also the thread you refer to is patching a Toggle/check box to a Text field, not a yes/no field.

 

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.

Visit my blog Practical Power Apps

Sorry for the late response. I had already on Formula Level Error Management. I achieved it from your source by understanding but the issue is different now like sometimes it works and sometimes not. i.e. sometimes got messages as a patch issue.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

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