M.App Enterprise Discussions

Discuss topics with other M.App Enterprise Product pioneers and experts to get the most out of it.
Showing results for 
Search instead for 
Do you mean 
Reply
Occasional Contributor
Posts: 12
Registered: ‎11-15-2015
Accepted Solution

Nested Filter in the Workflow List

Hi All, 

 

Is it possible to create a "Nested Filter" in a List. An Example would be,  I have a List of type of stores in different regions. I want to be able Filter by Region and within that region select set be able to filter for the type of stores i Want to see from that List.

 

Kind Regards

Siya

Technical Evangelist
Posts: 645
Registered: ‎11-12-2015

Re: Nested Filter in the Workflow List

Yes this is possible. The second filter will take its value from the first applied filter.

Below I have two fields from a list that are filterable Crime Type and Location. The filter for Location is based on what is selected value in Crime Type filter.

 

Here is XML for the two fields used as the list filter:

 

<FormField editable="true" label="Crime Type" name="RUCR_EXT_D" visible="list,filter" type="combobox" saveinsession="false" persisted="true" required="true" datatype="string" lov="SQL[select distinct RUCR_EXT_D from Crime order by RUCR_EXT_D]"/>

<FormField editable="true" label="Location" name="LOCATION" visible="list,filter" type="combobox" saveinsession="false" persisted="true" required="true" datatype="string" lov="SQL[select distinct LOCATION from Crime where RUCR_EXT_D={FILTER.RUCR_EXT_D}]"/>

 

Workflow result of this example:

 

nestedFilter.PNG

Frequent Contributor
Posts: 114
Registered: ‎05-25-2016

Re: Nested Filter in the Workflow List

Hi there sclow, is it possible to get the XML for the entire form? I can´t get the example to work.

first filter loads fine but second one won’t populate. The value " visible="list,filter" " is not working for me either and don’t know the query you are using to populate the list

 

Occasional Contributor
Posts: 12
Registered: ‎11-15-2015

Re: Nested Filter in the Workflow List

Hi Stephen , 

 

Thanks for your response

I have configured  the filter attribute as  below : 

<FormField name="DC_NAME" label="District Name" editable="true" visible="list,filter" datatype="string" lov="SQL[select distinct DC_NAME from Gauteng_POIs order by DC_NAME]" required="true" persisted="true" saveinsession="false" type="combobox" />
<FormField name="MP_NAME" label="Suburb" editable="true" visible="list,filter" datatype="string" lov="SQL[SELECT DISTINCT MP_NAME from Gauteng_POIs WHERE DC_NAME={FILTER.DC_NAME} order by MP_NAME ASC]" required="true" persisted="true" saveinsession="false" type="combobox" />
<FormField name="CAT_TYPE" label="POI Type" editable="true" visible="filter" datatype="string" lov="SQL[SELECT DISTINCT CAT_TYPE from Gauteng_POIs WHERE MP_NAME={FILTER.MP_NAME} order by CAT_TYPE Asc]" required="true" persisted="true" saveinsession="false" type="combobox" />

 

 

It seems to work , but sometimes it does not clear the selected filter properly. I havent managed to get the third filter column to display , I am trying to figure out what i might have missed. 

 

Other than that it works . Thanks a lot

 

 

 

Kind Regards

Siya

Occasional Contributor
Posts: 12
Registered: ‎11-15-2015

Re: Nested Filter in the Workflow List

Did you use the Crimes Table ? 

Technical Evangelist
Posts: 645
Registered: ‎11-12-2015

Re: Nested Filter in the Workflow List

Greetings,

 

I am happy to help out when and where I can.

Of course my example is meant to present the concept and provide a working example. It would need to be manipulated to a user's specific case.

I have attached the complete FormSettings.xml (in .zip) in hopes that it helps clarify any further questions with regards to this particular example of a nested filter. Be aware that it contains other components to this workflow that of course are not pertaining to this topic.

 

HTH

Highlighted
Frequent Contributor
Posts: 78
Registered: ‎10-12-2015

Re: Nested Filter in the Workflow List

[ Edited ]

Hello,

 

I tried to implment this method, but the only way I noticed it works is by using the following Steps:

Select Category Filter -> Apply Filter -> Reload Page -> Select Type Filter (Filtered by Category)

 

Expected behaviour:

Select Category Filter -> Select Type Filter (Filtered by Category)

 

The type filter does not seem to dynamically reload when the category filter is selected in the combobox (as it does in the form controller).

Did I miss something or is this just how it works?

Can it be configured so it matches my expected behaviour stated above?

 

Regards,

Radu

Frequent Contributor
Posts: 114
Registered: ‎05-25-2016

Re: Nested Filter in the Workflow List

I agree, the content of the second combo box is not updated when the selected value changes on the first filter. The values from filter two are populated on load so if there is nothing selected in filter one at that time, then the second filter query wont pe processed correctly 

Technical Evangelist
Posts: 645
Registered: ‎11-12-2015

Re: Nested Filter in the Workflow List

Thanks users.

Upon further review, I have to agree this solution is only viable in specific workflow and maybe not even the expected workflow.

The first time through, it seems to hold up but the usefulness doesn't stand up over user iterations which of course should be expected.

No excuses, only that I didn't test it thoroughly enough. I'll take another look at it as soon as I can.

Occasional Contributor
Posts: 12
Registered: ‎11-15-2015

Re: Nested Filter in the Workflow List

Hi Stephen , 

 

Can you also share the scripts related to to the workflow you shared.