How do I get a Smart Dropdown to JOIN based on another dropdown?
Asked by Kathleen Janiszewski:

I have a ConfiForm full of fiscal years, week numbers and text for each week that I want displayed on a smart dropdown. Right now, I have all of the weeks for FY 2023 and FY 2024 in there.  

![weeks confiform.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/261454iD0973B7A973E5062/image-size/large?v=v2&px=999 "weeks confiform.PNG")  

I also have a dropdown with the fiscal years hardcoded in the dropdown:  
![fiscalYear.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/261455i46AB047C65718E73/image-size/large?v=v2&px=999 "fiscalYear.PNG")

I want the smart dropdown to populate with the week titles (there could be 52 or 53 of them) depending on the fiscal year. How can I do a JOIN from the fiscalYear field to the Fiscal Year of the smart dropdown? I have tried a smart classifier, but this won't work, because they're in different div's. I tried a filter, and that did not work. Any ideas?


Answers:
author: Alex Medved _ConfiForms_
body: Hi [@Kathleen Janiszewski](/t5/user/viewprofilepage/user-id/5163300)

The easiest way is just to put a smart classifier field in the form that will use your weeks form as a source.

No need to join anything

First field in the smart classifier would be the year and the second would be the week number or the week range

Other option is to set up 2 fields, one to source the data from years form and another from the weeks form and use the <https://wiki.vertuna.com/display/CONFIFORMS/ConfiForms+Field+Definition+Rules#ConfiFormsFieldDefinitionRules-ApplyFilteronafield> rule to filter out items from the second field (weeks) based on the selection being made in the first (year)

Alex

comments: author: Kathleen Janiszewski
body: Alex,

The Fiscal Year is at the top, and the Start Week and End Week are in a 2nd div that is hidden and unhidden based on the next value, which is a radio button. Is it possible to use a smart classifier when the dropdowns are not sequential? According to my colleague, it's not. This is what my registration form looks like:![Registration form.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/261606i8B820ADFCC80ECC9/image-size/large?v=v2&px=999 "Registration form.PNG")  
Thank you for your help here!

-Kathleen J


author: Alex Medved _ConfiForms_
body: Hi [@Kathleen Janiszewski](/t5/user/viewprofilepage/user-id/5163300)

Not sure what do you want to show with this screenshot, but your colleague is right - the smart classifier field cannot be split into multiple pieces. It is just one field - it can be rendered as an N number of (cascading) dropdowns (selects), but it is still a 1 field.

Alex


author: Kathleen Janiszewski
body: Alex,

Sorry to have blacked out so much. The user selects the fiscal year. The next field is a radio box which I'll call, "type." Depending on "type", the bottom div will display or not display. The Fiscal Year is relevant for all types. The Start Week and End Week are only relevant for 1 type.

Yes, the 2nd method you had recommended is the one I was going with. I wasn't able to get it working. Perhaps my filter is incorrect. Or perhaps I need to put the years in their own form rather than having them hardcoded. I can do that, but the value and text are the same: years 2023 thru 2030. However, I doubt they'll be using this software beyond FY 2026.

Thank you again for your help!

-Kathleen


author: Alex Medved _ConfiForms_
body: What filtering expression do you have? And what is the form configuration (field names in the weeks form)?

Alex


author: Kathleen Janiszewski
body: Alex,

The field names in the weeks form are fiscalYear, weekNumber, weekRange, and uniqueId (I don't use uniqueId yet).

The filter is in the ConfiForms Rules for Field Defintions for fiscalYear, below:

![Confiforms Rules on fiscalYear 1.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/261622i20BFE2C6BCAD9754/image-size/large?v=v2&px=999 "Confiforms Rules on fiscalYear 1.PNG")![Confiforms Rules on fiscalYear 2.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/261625i782BDCA545B525EF/image-size/large?v=v2&px=999 "Confiforms Rules on fiscalYear 2.PNG")![Confiforms Rules on fiscalYear 3.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/261626i2020D3E6371D6251/image-size/large?v=v2&px=999 "Confiforms Rules on fiscalYear 3.PNG")

I think the problem is that I'm not linking this rule to the definiton of startWeek. How would I do that? I tried a number of different scenarios last night, and I don't remember them all.  

![confiforms startWeek field defintion.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/261627i365E8136F1AD4BBB/image-size/large?v=v2&px=999 "confiforms startWeek field defintion.PNG")

Thank you!

-Kathleen


author: Alex Medved _ConfiForms_
body: Hi

I was talking about this Field Definition Rule - <https://wiki.vertuna.com/display/CONFIFORMS/ConfiForms+Field+Definition+Rules#ConfiFormsFieldDefinitionRules-ApplyFilteronafield> (Apply Filter on field)

Here is the demo of what I was trying to suggest

<http://recordit.co/3hPgVaNP8t>

Alex


author: Kathleen Janiszewski
body: Alex,

Yes! That got it working!!! Thank you for your help!

Kind Regards,

-Kathleen


author: Kathleen Janiszewski
body: Alex,

I still need the dropdown to store the week numbers, not the test on the labels. I expect it to work the same way a regular dropdown works. My code is completely dependent on week numbers. See below:  

![Week Ranges.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/261805i5DB955F12A7E1A65/image-size/large?v=v2&px=999 "Week Ranges.PNG")

Thank you in advance.

-Kathleen


author: Alex Medved _ConfiForms_
body: I don't quite understand this.

Smart fields store a reference to a record... which can be used to get any fields in the form that it references...

Alex


author: Kathleen Janiszewski
body: Alex,

Thank you. My colleague helped me to get the data I needed from \[entry.startweek.weekNumber\]

Thank you again.

-Kathleen


author: Alex Medved _ConfiForms_
body: Yes, that is what I was trying to hint at - you can use smart fields as a "bridge" to jump to the values/fields that it is referencing in the other form

Good to have such a great colleague! :-)

Alex


author: Kathleen Janiszewski
body: Alex,

Yes! He's awesome!

Thanks again!

-Kathleen


Tags: confiforms

confluence-server

server