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

View/Hide Card

So I have an equipment log/asset list app made to help our mechanic so he can sort the list of machines and add notes and maintenance info. Im trying to add a toggle switch to hide that particluar asset in the list.

Right now my screens go 

Full List -> Click to go to individual asset -> click pencil to edit -> then in edit I want to add a toggle to hide that individual asset from the full list.

Any suggestions on formulas? Im currently pulling my data from a common data service list.

5 REPLIES 5
PowerApps Staff carlosag
PowerApps Staff

Re: View/Hide Card

If I understand correctly you could add a Column for example "Status" and have that be an Active/Inactive (or any other values that makes sense for the scenario), and the Filter by that column to only show the ones you care.

 

For example, if we use the "Account" standard entity in CDS, there is a column Status with Active/Inactive values. In the default "App from Data" generated expression in the Full List you have an expression like:

 

If you add a Filter expression like:

Filter(Account, Status = "Active")

 

Then you get the desired behavior, and when you change a row to be Inactive it will not be shown in the full List. (The one caveat is you would not be able to mark it Active again, so you might want to add a checkbox "Show Inactive" where there you could change your expression like:

Filter(Account, Status = "Active" || showInactiveCheckBox.Value )

 

That way when you check/uncheck the Inactive accounts will be shown or not.

 

 

Sweeney669
Level: Powered On

Re: View/Hide Card

So I tried adding the fileter expression into Data: Items but it wont accept it. 

Currently my formula in items is:

SortByColumns(Search(Equipment, TextSearchBox1.Text, "CreatedByUser","LastModifiedByUser","Make"), "Category", If(SortDescending1, Descending, Ascending), Filter(equipment,owned="yes"))


I added a column called "owned" with yes and no filled into each cell. I have a toggle switch in my "edit" page that defaults to whatever the owned column is set to. That works fine, so when owned=yes then the toggle=true. Not sure why that one works but my data items wont.

Also with my toggle set like that, I want to be able to set it to "false" and switch the value + my filter to change that asset to owned=false. Am I on the right track? What am I missing?

PowerApps Staff carlosag
PowerApps Staff

Re: View/Hide Card

Try this:

Filter(SortByColumns(Search(Equipment, TextSearchBox1.Text, "CreatedByUser","LastModifiedByUser","Make"), "Category", If(SortDescending1, Descending, Ascending), owned="yes"))

 

Sweeney669
Level: Powered On

Re: View/Hide Card

Nope, Invalid argument :/, tried that one before too

PowerApps Staff carlosag
PowerApps Staff

Re: View/Hide Card

Sorry, I closed the parenthesis incorrectly, try:
Filter(SortByColumns(Search(Equipment, TextSearchBox1.Text, "CreatedByUser","LastModifiedByUser","Make"), "Category", If(SortDescending1, Descending, Ascending)), owned="yes")

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,355)