web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Gallery Items (Toggle ...
Power Apps
Unanswered

Gallery Items (Toggle Control)

(0) ShareShare
ReportReport
Posted on by

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

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,042 Most Valuable Professional on at

    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

  • manojrohit16 Profile Picture
    on at

    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

     

     

  • WarrenBelz Profile Picture
    153,042 Most Valuable Professional on at

    @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

  • manojrohit16 Profile Picture
    on at

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

     

     

  • WarrenBelz Profile Picture
    153,042 Most Valuable Professional on at

    @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 Profile Picture
    on at

    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-Automatically/td-p/518161

     

    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

  • WarrenBelz Profile Picture
    153,042 Most Valuable Professional on at

    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

  • manojrohit16 Profile Picture
    on at

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard