cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Paida
Advocate I
Advocate I

Power fx formula not working in Canvas App

Hi 

Please may you assist I used this formula in my Canvas App to filter the gallery:

Search('Animal Infos',Searchtxt.Text,'Shelter Name') but nothing happens.
 
I have tried all the other formulas that people have suggested but I keep getting errors.
 
Please help



1 ACCEPTED SOLUTION

Accepted Solutions
BCBuizer
Multi Super User
Multi Super User

Hi Everybody,

 

I see many different techniques being used to get the overview of all animals that are ready for adoption, so let me try to name and explain them a bit to provide some clarity.

 

To establish some commonalities: 

All methods apply to the Items property of a gallery to show all rows in the 'Animals' table that have a value in the Choice type column 'Shelter status' that indicates whether or not the animal is ready for adoption. Depending on the names you have chosen for the table or the column, you may need to change 'Animals' of 'Shelter status' in any of the given formulas.

 

1. Filter by Label

This is the method that is shown in the course videos when building a canvas app for the School Library solution. To use this, you need to apply a Filter function. In the condition of the function you select the 'Shelter Status' and compare that against a certain value. Assuming you are also using a choice set that is not synced with global choice, you can just type the name of the column again, followed by the label. In case spaces are included anywhere, the identifier needs to be wrapped in single quotes:

 

Filter(
    'Animals',
    'Shelter status' = 'Shelter status (Animals)'.'Ready to be fostered'
)

 

 

2. Filter by Value

As mentioned by @Corry , an alternative way of filtering is through the value where you don't use the Label of the Choice set, but the value. A downside of this is that these values are not descriptive, so you'll be forced to check you choice set often to check if you used the correct values, so that's why I recommend using option 1 over this option:

 

Filter(
    'Animals',
    'Shelter status' = 123456
)

 

 

3. Filter by View

The last option as mentioned by @ZeeScience is to filter by view. In this case you need to create a view for the Animals table in your solution that includes a filter to show only the animals that are ready for adoption. This can be done through the solution explorer in a similar fashion as in the course video for the School Maintenance app where a view is created for any outstanding issue. Once the view is created, you can use it as a condition in the Filter function in a canvas app:

 

Filter(
    'Animals',
    'Animals (Views)'.'Ready to be fostered view'
)

 

 In the above I first selected the views ('Animals (Views)') and then entered the name of the view to be applied ('Ready to be fostered view').



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

View solution in original post

9 REPLIES 9

What exactly do you want the filter to do?

Paida
Advocate I
Advocate I

I am trying to filter ready to foster data on my gallery

 

Corry
Advocate V
Advocate V

Hi @Paida,

 

I personally am using a switch function with a sort by columns and filter but all you need is the following formula in the ITEMS property of your GALLERY. 

Filter(Table Name'Choice Column Name' = Value of the choice you are filtering on)

 

Filter(Animals,'Shelter Status' = 333330005)

Corry_1-1716327776957.png

 

You can get the choice values by selecting the column in the table, in your solution.

 

Corry_0-1716327556143.png

 

 

 

 

Try this:

 

Search(Filter('Name of Animal Table', 'Name of Animal Table (Views)'.'Ready for Foster'), Name of Text Search Card.Text, 'Shelter Name')

 

Hi All 

I didnt see any error with both formulas but still no data 

BCBuizer
Multi Super User
Multi Super User

Hi Everybody,

 

I see many different techniques being used to get the overview of all animals that are ready for adoption, so let me try to name and explain them a bit to provide some clarity.

 

To establish some commonalities: 

All methods apply to the Items property of a gallery to show all rows in the 'Animals' table that have a value in the Choice type column 'Shelter status' that indicates whether or not the animal is ready for adoption. Depending on the names you have chosen for the table or the column, you may need to change 'Animals' of 'Shelter status' in any of the given formulas.

 

1. Filter by Label

This is the method that is shown in the course videos when building a canvas app for the School Library solution. To use this, you need to apply a Filter function. In the condition of the function you select the 'Shelter Status' and compare that against a certain value. Assuming you are also using a choice set that is not synced with global choice, you can just type the name of the column again, followed by the label. In case spaces are included anywhere, the identifier needs to be wrapped in single quotes:

 

Filter(
    'Animals',
    'Shelter status' = 'Shelter status (Animals)'.'Ready to be fostered'
)

 

 

2. Filter by Value

As mentioned by @Corry , an alternative way of filtering is through the value where you don't use the Label of the Choice set, but the value. A downside of this is that these values are not descriptive, so you'll be forced to check you choice set often to check if you used the correct values, so that's why I recommend using option 1 over this option:

 

Filter(
    'Animals',
    'Shelter status' = 123456
)

 

 

3. Filter by View

The last option as mentioned by @ZeeScience is to filter by view. In this case you need to create a view for the Animals table in your solution that includes a filter to show only the animals that are ready for adoption. This can be done through the solution explorer in a similar fashion as in the course video for the School Maintenance app where a view is created for any outstanding issue. Once the view is created, you can use it as a condition in the Filter function in a canvas app:

 

Filter(
    'Animals',
    'Animals (Views)'.'Ready to be fostered view'
)

 

 In the above I first selected the views ('Animals (Views)') and then entered the name of the view to be applied ('Ready to be fostered view').



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

Thank you @BCBuizer for the comprehensive breakdown.

I went down the Filter by Value route as I was having difficulty with these formulas and the Filter by Value worked for me, so I stayed with it.

I have since updated my formulas to Filter by Label based on your guidance and it works perfect, thank you 😊

@BCBuizer thank you for the extensive explanation it was really helpful

@BCBuizer This was such a detailed and helpful response. Do you have a breakdown similar to this for the Patch Formula. I have tried many combinations, and all end up in error.

Helpful resources

Announcements

Important Update | Power Up Community READ ONLY July 22 – July 28

Dear Community Members, As you may have read, the Power Platform communities are transitioning to a new platform and to access will be set to READ-ONLY mode during the transition. Key DatesTo ensure current learners have adequate support in the final week of the cohort, the Power Up Program Community will transition to READ-ONLY mode starting July 22nd, the platform will transition to READ-ONLY mode until July 28th. Power Apps, Power Automate, and Power Pages communities will be read-only July 16-22, 2024.During this period, members will not be able to start new threads or Kudo, Comment, or Reply to any posts, but will be able to search and review past threads or solutions. On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities. Learners will be able to sign in to the new Power Up Program community experience, starting July 29th. If you registered for community using your learnwithpowerup account, you will not receive an email, but should be able to sign in successfully if you are signed in to My hub.  If you need help with your community account, please submit a request at aka.ms/PPCommSupport We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead! 

Learn what to expect in the Power Up Program

Since its inception in 2022, the Power Up Program has evolved based on feedback from learners and Microsoft Partners and customers. Today's Power Up learners can expect to learn the fundamentals of Microsoft Power Platform in the accelerated seven-week, video-based Power Up Maker course.   Hear from Principal Program Manager, Dimpi Gandhi to discover the latest enhancements and meet the Microsoft MVPs, Rory Neary and Charlie Phipps, who partnered with the Microsoft Power Up Program to create the Power Up Maker course to guide learners to use the Microsoft Power Platform to develop custom applications, build dazzling report dashboards, or create efficiencies through automation.  

Welcome to the Power Up Program Community

The Power Up Program is a free upskilling program where nontechnical people can learn the fundamentals of Microsoft Power Platform. The Power Up Maker course is a seven-week self-paced virtual learning plan that include video-based objectives featuring Power Apps, Power BI and Power Automate.  As a member of the Power Up Community, you can grow your skills and build connections. You can post questions to get help with the curriculum and hands-on exercises from experts and peers in the product boards.  Check out the Community Information & Feedback board to find help or provide feedback with the community experience, and please take time to post in the Social board to tell us more about yourself. If you're new to the Power Up Program and looking for information to register. You can sign up at PowerUp.Microsoft.com.

Users online (1,597)