Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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

 

  • manojrohit16 Profile Picture
    on at
    Re: Gallery Items (Toggle Control)

    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.

  • WarrenBelz Profile Picture
    146,702 Most Valuable Professional on at
    Re: Gallery Items (Toggle Control)

    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
    Re: Gallery Items (Toggle Control)

    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
    146,702 Most Valuable Professional on at
    Re: Gallery Items (Toggle Control)

    @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
    Re: Gallery Items (Toggle Control)

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

     

     

  • WarrenBelz Profile Picture
    146,702 Most Valuable Professional on at
    Re: Gallery Items (Toggle Control)

    @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
    Re: Gallery Items (Toggle Control)

    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
    146,702 Most Valuable Professional on at
    Re: Gallery Items (Toggle Control)

    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

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,702 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard