How do you make dynamic dorpdowns from another form, where the dropdown values are uniquely listed?

I want to have multiple dropdowns on my form where the values from these dropdowns are coming from a second form.

As each field is selected, the next dropdown field should be filtered with the selected value.

I can get this to work, but all the dropdowns have repeated values. I want the dropdowns to contain a unique list of values, even if they belong to multiple rows on the source form.

If I change the field definition property: "Reference to field values" to false, I can get a unique list of values, but it breaks the filtering.

How can I accomplish this?

 

Here is my source code:

<ac:structured-macro ac:name="confiform">
<ac:parameter ac:name="formName">dd</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:name="confiform-entry-register">
<ac:parameter ac:name="formName">dd</ac:parameter>
<ac:parameter ac:name="embedded">true</ac:parameter>
<ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
<ac:rich-text-body>
<p> </p>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:name="confiform-field-definition">
<ac:parameter ac:name="fieldName">mychoice1</ac:parameter>
<ac:parameter ac:name="fieldLabel">My choice 1</ac:parameter>
<ac:parameter ac:name="values">[277274429|esf|domain|true||domain.label]</ac:parameter>
<ac:parameter ac:name="type">smartselect2</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:name="confiform-field-definition">
<ac:parameter ac:name="fieldName">mychoice2</ac:parameter>
<ac:parameter ac:name="fieldLabel">My choice 2</ac:parameter>
<ac:parameter ac:name="values">[277274429|esf|program|true||program.label]</ac:parameter>
<ac:parameter ac:name="type">smartselect2</ac:parameter>
</ac:structured-macro>
</p>
<p> </p>
<p>
<ac:structured-macro ac:name="confiform-field-definition-rules">
<ac:parameter ac:name="fieldName">mychoice2</ac:parameter>
<ac:parameter ac:name="values">domain:[entry.mychoice1.domain]</ac:parameter>
<ac:parameter ac:name="action">Apply Filter on a field</ac:parameter>
<ac:parameter ac:name="actionFieldName">mychoice1</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>

 

2 answers

I believe that having a "Smart classifier" field in your "dd" form, pointed at "esf" form with fields "domain" and "program" will be a much better option

As the field type provides exactly what you are looking for, a way to have "dependent" dropdowns which are based on the data from single form

Thank you, this seems like it should work. I also found this page which demonstrates the behavior, but does not show the source:
https://wiki.vertuna.com/display/TEST/Using+smart+classifier+field+built+from+a+from+with+3+columns+-+3+levels+deep+classifier

 

However, I am encountering a bug when trying to use the Smart Classifier field.

Inside the "Edit ‘ConfiForms Form Field (Definition)’ Macro", I can not get the part for "Page where the ConfiForms Form is defined" to recognize any of my pages with forms.

I try to edit the source and the field does not show up at all after saving:

<ac:structured-macro ac:macro-id="377863af-ac97-4ca0-bb9d-4dbcb5eaf670" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">sm</ac:parameter>
<ac:parameter ac:name="fieldLabel">Smart Classifier</ac:parameter>
<ac:parameter ac:name="values">[322992200:esfform:product]</ac:parameter>
<ac:parameter ac:name="type">smartclass</ac:parameter>
</ac:structured-macro>

 

Any advice on why the Smart Classifier option will not recognize my pages where I have forms defined? It does find some pages where I do not have any forms.

Most probably you need to rebuilt the search index, as these page lookups use the search index, and if you cannot see the page in the lookup results then it is, most obviously, means your index is obsolete

https://confluence.atlassian.com/doc/content-index-administration-148844.html

I was able to update the source like this and get it to work; but the "Page where the ConfiForms Form is defined" dropdown still does not recognize my page when trying to use the macro form.

Using this format in the source worked:
<ac:structured-macro ac:macro-id="53d87136-10de-401f-a784-c151d0f70a97" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">product</ac:parameter>
<ac:parameter ac:name="fieldLabel">Application</ac:parameter>
<ac:parameter ac:name="values">[322992200:esfform]product,service,channel,function,maxpriority,externalname,mim,</ac:parameter>
<ac:parameter ac:name="type">smartclass</ac:parameter>
<ac:parameter ac:name="required">true</ac:parameter>
</ac:structured-macro>

Is there anyway to have one of the dependent fields as a multiselect by using Smart Classifier?

Field of "Smart Classifier" type is designed to allow users to pick just one option from the dynamically filtered set of options

 

You can setup a smart multi-select field and have a field definition rule with action to "apply filter" configured to filter out the selections in this multi-select field based on the selections made in some other field

Thank you I was able to get this to work, but my filtered results shows duplicate values.

Is there anyway to only get unique values returned back to the Smart Mulitselect?

And would it be possible to have another multiselect that depends on the values of my previously filtered Smart Multiselect?

Basically, there are many dependent dropdowns which would all be multiselect fields; depending on the values in previous multiselect.

What are duplicates and what are unique values in the multi-select when we talk about records filtered by the rule - I need to see an example of what you have, as most probably these are ALREADY unique records... but representing the same values

There are no any limits on how many fields per form you can have. And yes, you can do a smart multi-select which depends on the values selected in another smart multi-select. No limit here either... except the complexity it brings and has

Thanks for the feedback.
I've drafted a couple test forms to depict this scenario and posted it as a new question:
https://community.atlassian.com/t5/Marketplace-Apps-questions/ConfiForms-How-to-eliminate-duplicate-values-from-a-Smart/qaq-p/911257#M48513

I hope it makes sense and I hope that I'm overlooking some simple solution :)

Hello, I am new to Confiforms and looking for exactly this. I will not have trouble with duplicates, as each filter (based on first dropdown) will only have unique values. But I have no clue how to get this done. Is it possible to get above mentioned source code imported? Currently I am trying to get this work with all the different macros but without success. 

You can import the storage format with Confluence source editor app

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Wednesday in Marketplace Apps

Marketplace Spotlight: Marketing apps for Confluence to keep your teams working on the same page

                                                      &nbsp...

125 views 0 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you