cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Largomax
Level: Powered On

Using a toggle button on Sharepoint List

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?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Meneghino
Level 10

Re: Using a toggle button on Sharepoint List

Hi @Largomax

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.

9 REPLIES 9
Meneghino
Level 10

Re: Using a toggle button on Sharepoint List

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.

Largomax
Level: Powered On

Re: Using a toggle button on Sharepoint List

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
Level 10

Re: Using a toggle button on Sharepoint List

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
Level 10

Re: Using a toggle button on Sharepoint List

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

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

Largomax
Level: Powered On

Re: Using a toggle button on Sharepoint List

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

Meneghino
Level 10

Re: Using a toggle button on Sharepoint List

Hi @Largomax

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.

Largomax
Level: Powered On

Re: Using a toggle button on Sharepoint List

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

Largomax
Level: Powered On

Re: Using a toggle button on Sharepoint List

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
Level 10

Re: Using a toggle button on Sharepoint List

@Largomax

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.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 42 members 4,009 guests
Please welcome our newest community members: