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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Toggle button in galle...
Power Apps
Answered

Toggle button in gallery to update SP list

(0) ShareShare
ReportReport
Posted on by 87

Hi,

 

I'm struggling to get a toggle (yes/no) to update a sharepoint list when changed.

I have put the toggle in a gallery so that I can update each item but I can't get it to work.

Sharepoint list: Liste_1

Column to update (Yes/No): Til_fakturering

 

Toggle button Default:

If(
ThisItem.Til_fakturering.Value = true,
true,
false
)

Toggle button OnSelect:

Patch(
Liste_1,
LookUp(
Liste_1,
ID = ThisItem.ID
),
{
Til_fakturering: If(
Toggle3.Value = true,
true,
false
)
}
)

 

Does anyone know why this is not working?

 

Categories:
  • Verified answer
    SebS Profile Picture
    4,869 Super User 2026 Season 2 on at

    @Gundi76 

     

    If You looking to store the value true/false in Yes/No column You over complicate it

     

    It should be simple as:

     

    in Toggle button OnChange rather OnSelect:

     

    Toggle button OnChange:
    
    Patch(
    Liste_1,
    ThisItem,
    {
    Til_fakturering: Toggle3.Value
    }
    )

     

     

    Toggle on it own as a result of switching it contain true or false so no need for if condition

     

    In the Default property place ThisItem.Til_fakturering that will set up all toggles to whatever is in the List on DataSource Load

     

     

  • Gundi76 Profile Picture
    87 on at

    Thanks @SebS ,

     

    I still get "The function Patch has some invalid arguments - location: Toggle 3 . OnChange" & "The type of this argument 'Til_x0020_Fakturering' does not match the expected type 'Record'. Found type 'Boolean' - Location: Toggle 3 . OnChange"

     

    Is this because I have Yes/No in the column choice field?

  • SebS Profile Picture
    4,869 Super User 2026 Season 2 on at

    @Gundi76 

     

    Do you use Choice Column rather Yes/No in SharePoint List by any chance ?

  • Gundi76 Profile Picture
    87 on at

    @SebS It's a choice column (Yes/No)

  • SebS Profile Picture
    4,869 Super User 2026 Season 2 on at

    @Gundi76 

     

    Confused 🙂

     

    In SharePoint there is a Yes/No column this one can store only true/false and 

    there is a Choice column what you can pre-set choices choices like Yes / No , Red , Green 

     

    Witch one You using is it first Yes/No or the second as there is a difference how You patching it but I recommend to Use Yes/No column for that type of actions

  • Gundi76 Profile Picture
    87 on at

    @SebS I changed the column to Yes/No and now it works :). Thanks for your help 🙂

  • SebS Profile Picture
    4,869 Super User 2026 Season 2 on at

    @Gundi76 

     

    No Problem 

     

    also just for reference if You patching Choice column You need Patch to it Value

     

    This would look like this but also You will need to make sure the Toggle3 will be Yes/No rather true / false and to do that You will need If condition what makes it complicated and not worth the hassle

    Patch(
    Liste_1,
    ThisItem,
    {
    Til_fakturering: {Value:IF(Toggle3.Value,"Yes","No")}
    }
    )

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 352 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard