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 / Using a toggle button ...
Power Apps
Answered

Using a toggle button on Sharepoint List

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I try to do a toggle button in order to switch on sharepoint list between server / desktop. I try with sortbycolumn but with no effect.

I try with that whit no results :

OnCheck:

Filter(Inventaire,First(Filter(Inventaire,"Type_x0020_De_x0020_Machine"=Server)),{ColumnTitle:"true"})

 

The "Type_x0020_De_x0020_Machine" is a value not show in table but is on each Machine. On our powerapss homepage we have only : Constructor, Name of machine, Image. But When you click on it you have other information as "Type_x0020_De_x0020_Machine"

 

I need your help ? Do you have any Idea?

 

 

Categories:
  • Meneghino Profile Picture
    6,949 on at

    Hi, this is a common issue at the beginning.  The filtering is determined by the Items property for the gallery where you are showing your machines, it is not an event triggered by the changing of the toggle state.

     

    Once you find that property then you need to include the filter expression with the value of the toggle, something like this:

    MyGallery.Items = Filter(Inventaire, "Type_x0020_De_x0020_Machine"= If(MyToggle.Value, "Server", "Desktop"))

     

    Please let me know how I can help you further.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank's a lot but this Items property is not properly include on gallery. I have only:

    - manufacturer

    - machine name

    - picture

     

    Type of machine is include on all object after you have click on it you have a second screen with all property.

  • Meneghino Profile Picture
    6,949 on at

    Hi, the property of the control in PowerApps, i.e. the Items property, not the content of your list.

    Please see screenshot below.  The big blue circle is the gallery, you can see its name in the small blue circle (Gallery1)

    The red piece is the property of the gallery, in this case the Items property is selected.

    Hence this is equivalent to:

    Gallery1.Items = SortByColumns(AddColumns(IceCream, "ValueQuantity", Value(Quantity)), "ValueQuantity", If(SortA, Ascending, Descending))

    CaptureGallery.JPG

  • Meneghino Profile Picture
    6,949 on at

    You can find a list of all properties of a gallery here:

    https://powerapps.microsoft.com/en-us/tutorials/control-gallery/

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi,

     

    Firstly thanks for all replies. Maybe I can't do what i want. You can see below 3 screenshots of my PWApps.

    1 - Homepage screen with 3 properties, you can search with user, manufacturer and machine. Result filter by machineCap1.PNG

    2 - I want to use toggle button to show only server, but how do this ? Because in BrowseGallery thise value is not explicit

    Cap2.PNG 3 - you can find this "complex value " on each object . Cap3.PNG

  • Verified answer
    Meneghino Profile Picture
    6,949 on at

    Hi @Anonymous

    I have come to realise that most things are possible with PowerApps, you just need to change the way you normally think.

     

    Thanks for the screenshots, it is now much clearer.  We can definitely make this work for you.

     

    Here is what you need to do to make it work in your case:

     

    Screenshot 1:

    Substitue the current Items property of BrowseGallery1 with this:

    Filter( SortByColumns( Search( Inventaire; TextSearchBox1.Text; "Utilisateur"; "Constructeur"; "Machine"); "Machine"; If(SortDescending1; Descending; Ascending)); Type_x0020_De_x0020_Machine = If(Toggle1.Value; "Server"; "Desktop"))

    Please note that your toggle is called Toggle1, you can see this in the name box in screenshot 2

     

    Screenshot 2:

    Substitute the OnCheck property of Toggle1 with simply false or just leave it blank.  You do not need to take any actions when the toggle is operated, PowerApps refreshes the gallery automatically.

     

    That is all.

     

    Please let me know how you get on.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello,

     

    Thanks for your help, I try your solution but I have an error: "=" is an invalid argument :

     

    Filter( SortByColumns( Search( Inventaire; TextSearchBox1.Text; "Utilisateur"; "Constructeur"; "Machine"); "Machine"; If(SortDescending1; Descending; Ascending)); Type_x0020_De_x0020_Machine = If(Toggle1.Value; "Server"; "Desktop"))

    I have already try to use this argument but never work

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Its work !!! I found a solution. I just have to add ".Value" after Type_x0020_De_x0020_Machine.Value 

     

    This is good solution for me:

    Filter( SortByColumns( Search( Inventaire; TextSearchBox1.Text; "Utilisateur"; "Constructeur"; "Machine"); "Machine"; If(SortDescending1; Descending; Ascending)); Type_x0020_De_x0020_Machine.Value = If(Toggle1.Value; "Server"; "Desktop"))

     

    Thanks agan for your help and patience! 

    Now I try to find solution for missing data from sharepoint in my apps.

  • Meneghino Profile Picture
    6,949 on at

    @Anonymous

    glad that we got it solved.  The reason you need to add .value is that your Type De Machine column is probably a choice column and not a text column.

    Please keep this in mind for the future.

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 221 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 120

Last 30 days Overall leaderboard