Sorting Using Reference Selector

I'm working on an application where my hierarchy looks something like Company Name  Company Division Company Locations Company Sales Per Month @ Each Location On the page where I want this data entered I want someone to first select the company name, which would then have the next reference selector only show the divisions for that specific company, and then the next reference selector only shows the location for that specific devision... and so on. My domain model is currently setup in a way where I am able to create a reference selector, and I am able to select each of these attributes. I am however not entire sure on how to create the tiered sorting.  From what I have read it looks like I should be doing this using a constraining path, however when I open the constraining paths under the reference selector there are no checkboxes for me to be able to select. (Screenshot below) Any advice would be greatly appreciated. Thanks!
1 answers

Hi Adam, 

You can achieve this by setting the selectable object source to "Xpath". Once you do that you can either write a constraint in the xpath constraint box or choose a constraint in the "constrained by" section.


For example:

From reading your question, I'm assuming your domain model looks similar to this.

And the record that a user would be entering into the system would be a sales record. And that this is where the references will be set to company, division, and location.

I created a page with a dataview of sale, and reference selectors for Company, Division, and Location. 

To constrict the Division selection based on the company selection, as well as location selection based on the division selection, you would add these two constraints.



Now no options will appear in the Location drop down until a division is chosen, and no option will appear in the division drop down until a company is chosen. 


If you wanted to take it a step further, you can add conditional visibility on the division and location drop downs to appear once their dependency association is set.


Conditional Visibility for Division reference selector


Conditional visibility for Location reference selector


Now the page will display the company drop down and wont display the division drop down until a company is selected. Same goes with Location and division.


Also to make all of this work, you would need administration screens to create a division and associate it to a company, as well as create a location and associate it to a division.


Hope this helps!



You could also use data source from microflow and create a microflow similar to this.


This way will only work if you use the conditional visibility. Otherwise the microflow will run before the reference to company is set and will always return an empty list.