Jump to content

Portal filtering includes empty values


muzz

This topic is 757 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have a portal which includes related data from 4 fields and I would like to filter records so that only those which include certain values will show. I have created a global field each of the fields with a drop-down list of values from each of the for fields in the portal however by default they are blank.

I can filter for fields which meet any of the drop down values however I can't find a way to stop records with empty values in any of those fields whose dropdown remains empty being included. Also the default appearance is filtered such that records with any of those fields empty are included - I want all records to show by default.

The portal filter currently looks like this where the globals are the filter selection fields and the Tasks are the fields in the related table I want to include:

SubProfiles::g_FilterBodyPart = Tasks::BodyPart   or 

SubProfiles::g_FilterLoad  =  Tasks::Load   or 

SubProfiles::g_FilterPosture  = Tasks::Posture   or 

SubProfiles::g_FilterFrequency  = Tasks::Frequency

I'd appreciate any help in setting up the filter such that it shows all related records when the global fields are empty (i.e. default state) and does not include  any records with any of the fields blank when filtered, only those which match the chosen value in the drop down from the globals.

I hope that is enough information, thanks in anticipation.

JobProfiles _filter_not_working.fmp12

Edited by muzz
Attach file
Link to comment
Share on other sites

If you want to disable the filter when the filtering field is empty, you can formulate the condition as: 

IsEmpty ( SubProfiles::g_FilterBodyPart ) or SubProfiles::g_FilterBodyPart = Tasks::BodyPart

I am a little confused by your other requirements. Usually, when you have several filtering fields, you would want the conditions to be cumulative (i.e. combined using the AND operator), not alternative as shown in your question.

 

Link to comment
Share on other sites

Thanks for your reply. Yes the idea is to refine the task list to those tasks that include any of the selections in any of the 4 categories mentioned, rather than only records that include all of the chosen values. 

I will try your recommendation above, however I'm not sure how to combine the requirements for all four fields - will they need to be expressed as: 

IsEmpty ( SubProfiles::g_FilterBodyPart ) or SubProfiles::g_FilterBodyPart = Tasks::BodyPart
and
IsEmpty ( SubProfiles::g_FilterLoad ) or SubProfiles::g_FilterLoad = Tasks::Load

etc

Thanks again.

Link to comment
Share on other sites

2 hours ago, muzz said:

I'm not sure how to combine the requirements for all four fields

I am not sure either - because I am still confused regarding what you want the resulting behavior to be. If you really want to "include any of the selections in any of the 4 categories", then you need to continue using the OR operator. But then you will not be "refining" the list by each added criterion; on the contrary, you will be expanding it.  

 

 

Link to comment
Share on other sites

Yes it is expanding at this stage. So a request may say "show me all the tasks that are performed in standing, but also show me all daily tasks irrespective of whether or not they are done in standing (but don't show me tasks that have an empty field in the Load and Frequency fields). Perhaps there is another method that works better? I may have to change from a drop down list to check boxes to allow multiple choices within fields so if there is a better way I may need to redesign.

Thanks again.

Link to comment
Share on other sites

OK, that's much clearer now. Except for the "don't show me tasks that have an empty field in the [other] fields" part. I presume that you do want to show ALL related records when all 4 filtering fields are empty? Or do you then want to exclude records that have an empty value in any one of the 4 fields?

 

3 hours ago, muzz said:

Perhaps there is another method that works better?

The alternative is to filter a relationship, not the portal. But I don't know if that would work better. Let's get the requirements completely clear first.

 

Link to comment
Share on other sites

Thanks for that. I think I will talk a bit more to the person asking for it and narrow down the actual requirements and work from there.

Link to comment
Share on other sites

This topic is 757 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.