Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to reference the value of a Smart Dropdown as text?

Curtis Freudigmann
Contributor
May 31, 2019

Hello! It's me again.

I am working with a Smart Dropdown and I am using an IFTTT to create a new page and also to send an email based on values entered in to a form. I have a form with a text box which dynamically creates values for a smart dropdown in another form. When the user selects an option from the smartdrop and submits the form, a new page is created and I am using the [entry.mySmartDropdownField] to try getting the new page to show the value selected. However, when the new page is created, instead of getting the text value I get a Hex value. (See Image) I was looking at virtual functions to try and convert this to text but did not see anything for it. Is there some other method I can use that is built in to confiforms to accomplish this?

sdValue.PNG

As always, thanks for the assistance!

-Curtis

2 answers

1 accepted

0 votes
Answer accepted
Curtis Freudigmann
Contributor
May 31, 2019

For those of you looking at this, I discovered there is a checkbox in the Form Field Definition macro for 'Reference to records'. If this box is UNchecked, the value comes through in text form.

-Curtis

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 11, 2019

When you uncheck the mentioned parameter then ConfiForms stores a plain value, not a reference to the field. Which may or may not be what you want. 

The drawback of this is that you loose the reference to original record and cannot access ANY other properties from a referenced form/record

While, when you have this option set you can access ANY other property from the form referenced

[entry.mySmartDropdownField.property_in_other_form]
Curtis Freudigmann
Contributor
June 11, 2019

For this, I only need to get the text of the selected item. It is being emailed and used to create another page to display the information. No need to access any other property from the referenced record.

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 11, 2019

Well, do you understand that smart fields they operate on IDs of the records they reference? And think of them as "bridges" to another forms

So, in order to get the "text" value you need to tell where this text value actually is and that is by telling the smart field to get it

[entry.mySmartDropdownField.property_in_other_form]

 property_in_other_form is YOUR TEXT FIELD in the form referenced by this smart field

Curtis Freudigmann
Contributor
June 11, 2019

Hmm, I am trying to wrap my head around this.

So for the Smart Dropdown, I have the page where the form is defined, I have the name of the form, and I have the field name in that form which I am using to populate the Smart Dropdown.

I am using [entry.mySmartDropdownfield] with the 'Reference to records' unchecked. When the form(containing the Smart Dropdown) is filled out, a new page is created to display this information, and it prints to that page the actualy text value an not the ID.

When I have 'Reference to records' checked, then the ID is what comes through.

Would I need to use something like [entry.mySmartDropdownField.text] or something along those lines?

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 11, 2019

I really struggle to explain this here... We have a doc, that says you can access ANY property from a referenced record using the smart field in your current form/record

If you have a "text" field in the referenced form then yes, you can access it [entry.mySmartDropdownField.text], and ANY other property in that form

 

Let me try with example...

 

So, imagine a form A with 1 field called "myfield", it is a smart dropdown field to form B with the structure: textfield and myotherfield

 

when you build your view over form 1 you can set the ConfiForms Field macro's field name to myfield and the default mapping you have for the dropdown will be used to render the value, but you can also put the myfield.textfield or myfield.myotherfield into the field's name and it will render the values REFERENCED by "myfield" from ANOTHER form

 

Now... imagine the "myotherfield" in form 2 is also a smart field and it references the form 3 with field myimage

... now... when I build the view over my form 1, I can GET this value for field myimage in form 3

myfield.myotherfield.myimage

Because everything is a reference and I can navigate through the dependencies as much as I want

Curtis Freudigmann
Contributor
June 11, 2019

Ok Alex,

I feel like I am getting a better feel for how the references work. In essence I can reference the properties from many fields as long as they are rendered by another smart field.

I originally posted this question because I wanted my Smart Dropdown which gets its values from another form to show all of the fields without showing duplicate values. I understand that this does not mean Unique values.

I have another question out on the community here which ties in directly to the work I am doing in this question. My end goal is to have a form (with two fields: 1 dropdown, 1 text field) which allows a user to pick a team from a standard dropdown and enter a team change in the text field.

In a second form I have 3 fields, (two of them are practically the same for testing..) The first field is a Smart Multiselect which gets its values based on the data in the first form's dropdown.. so a list of the teams. and then the next two fields, one is a Smart Dropdown (advanced) and the other is a Smart Classifier (again I am using two here for testing) which gets the values based on a Rules for Field Definition macro which executes "Apply filter on a field" which uses the [entry.field1.field2] reference.

When I have only a single team selected in the Smart Multiselect, all of that team's changes show as expected, however, when I select two or more teams in this Multiselect i get a message saying there are no matches.

In my other question you mention using the 'join' virtual function. So I have been trying to test that but no success yet. The issue I was having with this is it shows transform/join is based on id. Is this the ID which is created dynamically for the values in the smart select?

 

As always Alex, thank you for your endless support. I wouldn't be able to do this without you.

-Curtis

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 12, 2019

There is a comment on the question you mentioned -  have you tried to do what is advised? What expression do you have now with "join" function mentioned?

Curtis Freudigmann
Contributor
June 13, 2019

Please see the comment below. I'm not sure if it sends a notification on here if not a direct response..

0 votes
Curtis Freudigmann
Contributor
June 13, 2019

Well my understand is a bit lacking. I have tried

[entry.mychoice1.transform(changeTeam).join(changeTeam)]

 I have tried using it based on id as well so like

[entry.mychoice1.transform(id).join()]

In another form I can get .join() to work with a standard multi select. I can get the concatenation to work and email me the ids concatenated separated but 'OR id:' like the example.

But what I really want is to have a smart dropdown be filtered based on the values for multiple options in a multi select.

Below is my storage format to give you an idea of what I'm working with.

<p class="auto-cursor-target"><br /></p><ac:structured-macro ac:name="section" ac:schema-version="1" ac:macro-id="26138bab-5dd4-41fb-9aff-38b46dea32c5"><ac:rich-text-body>
<p class="auto-cursor-target"><br /></p><ac:structured-macro ac:name="confiform" ac:schema-version="1" ac:macro-id="a29f7d9f-7cd2-4c1d-ab1a-2b0c26004c92"><ac:parameter ac:name="formName">addChoices</ac:parameter><ac:rich-text-body>
<p><ac:structured-macro ac:name="confiform-field-definition" ac:schema-version="1" ac:macro-id="6c91b57e-155f-44b2-85bf-1518525decb6"><ac:parameter ac:name="fieldName">changeTeam</ac:parameter><ac:parameter ac:name="fieldLabel">Team Making Change</ac:parameter><ac:parameter ac:name="values">false[Apps Admin=Apps Admin|Apps Dev HD=Apps Dev HD|Data Warehouse=Data Warehouse|Group/Core Dev=Group/Core Dev|IAS Dev=IAS Dev|Infrastructure=Infrastructure|iSeries Admin=iSeries Admin|Middleware=Middleware|Salesforce Admin=Salesforce Admin|Salesforce Dev=Salesforce Dev|]</ac:parameter><ac:parameter ac:name="type">select</ac:parameter></ac:structured-macro></p>
<p><ac:structured-macro ac:name="confiform-field-definition" ac:schema-version="1" ac:macro-id="da72d710-3d61-457d-87a6-0218c463e8ec"><ac:parameter ac:name="fieldName">changeType</ac:parameter><ac:parameter ac:name="fieldLabel">Type of Change</ac:parameter><ac:parameter ac:name="type">text</ac:parameter></ac:structured-macro></p><ac:structured-macro ac:name="confiform-entry-register" ac:schema-version="1" ac:macro-id="404e1c1d-03e2-4e0c-a5b8-bbc11d820423"><ac:parameter ac:name="embedded">true</ac:parameter><ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter><ac:rich-text-body>
<h4>Team making change:</h4>
<p><ac:structured-macro ac:name="confiform-field" ac:schema-version="1" ac:macro-id="7e9e89af-48f7-463f-869a-c475d669ee3d"><ac:parameter ac:name="fieldName">changeTeam</ac:parameter></ac:structured-macro></p>
<h4>Type of change being made:</h4>
<p><ac:structured-macro ac:name="confiform-field" ac:schema-version="1" ac:macro-id="4555d7bf-39c4-4621-95c0-c30080d5dcb4"><ac:parameter ac:name="fieldName">changeType</ac:parameter></ac:structured-macro></p></ac:rich-text-body></ac:structured-macro>
<p class="auto-cursor-target"><br /></p></ac:rich-text-body></ac:structured-macro>
<p>Items in form <strong>f1choices</strong></p><ac:structured-macro ac:name="confiform-table" ac:schema-version="1" ac:macro-id="fbdcd47b-51da-4d5f-be36-c6585a53874e"><ac:parameter ac:name="formName">addChoices</ac:parameter><ac:rich-text-body>
<p><br /></p>
<p><ac:structured-macro ac:name="confiform-field" ac:schema-version="1" ac:macro-id="97494bb1-5b2c-43ef-8c40-cc93bcf3e3ba"><ac:parameter ac:name="fieldName">changeTeam</ac:parameter></ac:structured-macro></p>
<p><ac:structured-macro ac:name="confiform-field" ac:schema-version="1" ac:macro-id="f3abf462-8247-4587-b8ab-eb1baf47aa69"><ac:parameter ac:name="fieldName">changeType</ac:parameter></ac:structured-macro></p></ac:rich-text-body></ac:structured-macro>
<p class="auto-cursor-target"><br /></p><ac:structured-macro ac:name="confiform" ac:schema-version="1" ac:macro-id="b4af5bea-8524-4aba-bd16-c29950309b6d"><ac:parameter ac:name="formName">usingChoices</ac:parameter><ac:rich-text-body>
<p class="auto-cursor-target"><br /></p><ac:structured-macro ac:name="confiform-entry-register" ac:schema-version="1" ac:macro-id="33cd2744-9c85-49b5-bd17-35a3974c8415"><ac:parameter ac:name="embedded">true</ac:parameter><ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter><ac:rich-text-body>
<p><br /></p></ac:rich-text-body></ac:structured-macro>
<p><ac:structured-macro ac:name="confiform-field-definition" ac:schema-version="1" ac:macro-id="7eb7c532-f9f7-4132-b6db-223be71af597"><ac:parameter ac:name="fieldName">mychoice1</ac:parameter><ac:parameter ac:name="fieldLabel">My choice 1</ac:parameter><ac:parameter ac:name="values">[46566051|addChoices|changeTeam|false|false|]</ac:parameter><ac:parameter ac:name="type">smartmultiselect</ac:parameter></ac:structured-macro></p>
<p><ac:structured-macro ac:name="confiform-field-definition" ac:schema-version="1" ac:macro-id="f6f9babd-c175-41f2-b44e-524ce49c4ca0"><ac:parameter ac:name="fieldName">mychoice2</ac:parameter><ac:parameter ac:name="fieldLabel">My choice 2</ac:parameter><ac:parameter ac:name="values">[46566051|addChoices|changeType|true||]</ac:parameter><ac:parameter ac:name="type">smartselect2</ac:parameter></ac:structured-macro></p>
<p><ac:structured-macro ac:name="confiform-field-definition" ac:schema-version="1" ac:macro-id="831ce505-61a9-4684-9c42-62cb5f611842"><ac:parameter ac:name="fieldName">SC</ac:parameter><ac:parameter ac:name="fieldLabel">SC</ac:parameter><ac:parameter ac:name="values">[46566051:addChoices]changeType,</ac:parameter><ac:parameter ac:name="type">smartclass</ac:parameter></ac:structured-macro></p>
<p><ac:structured-macro ac:name="confiform-field-definition-rules" ac:schema-version="1" ac:macro-id="8ff8a8d7-b08f-40fb-9f7b-db7335a8fb15"><ac:parameter ac:name="fieldName">mychoice2</ac:parameter><ac:parameter ac:name="values">[entry.mychoice1.changeTeam]</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>
<p><ac:structured-macro ac:name="confiform-field-definition-rules" ac:schema-version="1" ac:macro-id="6fc5a531-f3cd-4093-ae92-f85f9a0c1b62"><ac:parameter ac:name="fieldName">SC</ac:parameter><ac:parameter ac:name="values">[entry.mychoice1.join(mychoice1)]</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>
<p class="auto-cursor-target"><br /></p></ac:rich-text-body></ac:structured-macro>
<p class="auto-cursor-target"><br /></p>
<p><br /></p>
<p><br /></p>
<p><br /></p>
<p><br /></p>
Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 13, 2019

Have a look at the following config

<ac:structured-macro ac:macro-id="26138bab-5dd4-41fb-9aff-38b46dea32c5" ac:name="section" ac:schema-version="1">
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="a29f7d9f-7cd2-4c1d-ab1a-2b0c26004c92" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">addChoices</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="6c91b57e-155f-44b2-85bf-1518525decb6" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">changeTeam</ac:parameter>
<ac:parameter ac:name="fieldLabel">Team Making Change</ac:parameter>
<ac:parameter ac:name="values">false[Apps Admin=Apps Admin|Apps Dev HD=Apps Dev HD|Data Warehouse=Data Warehouse|Group/Core Dev=Group/Core Dev|IAS Dev=IAS Dev|Infrastructure=Infrastructure|iSeries Admin=iSeries Admin|Middleware=Middleware|Salesforce Admin=Salesforce Admin|Salesforce Dev=Salesforce Dev|]</ac:parameter>
<ac:parameter ac:name="type">select</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="da72d710-3d61-457d-87a6-0218c463e8ec" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">changeType</ac:parameter>
<ac:parameter ac:name="fieldLabel">Type of Change</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<ac:structured-macro ac:macro-id="404e1c1d-03e2-4e0c-a5b8-bbc11d820423" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="embedded">true</ac:parameter>
<ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
<ac:rich-text-body>
<h4>Team making change:</h4>
<p>
<ac:structured-macro ac:macro-id="7e9e89af-48f7-463f-869a-c475d669ee3d" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">changeTeam</ac:parameter>
</ac:structured-macro>
</p>
<h4>Type of change being made:</h4>
<p>
<ac:structured-macro ac:macro-id="4555d7bf-39c4-4621-95c0-c30080d5dcb4" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">changeType</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
</ac:rich-text-body>
</ac:structured-macro>
<p>Items in form <strong>f1choices</strong>
</p>
<ac:structured-macro ac:macro-id="fbdcd47b-51da-4d5f-be36-c6585a53874e" ac:name="confiform-table" ac:schema-version="1">
<ac:parameter ac:name="formName">addChoices</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
<p>
<ac:structured-macro ac:macro-id="97494bb1-5b2c-43ef-8c40-cc93bcf3e3ba" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">changeTeam</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="f3abf462-8247-4587-b8ab-eb1baf47aa69" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">changeType</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="b4af5bea-8524-4aba-bd16-c29950309b6d" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">usingChoices</ac:parameter>
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="33cd2744-9c85-49b5-bd17-35a3974c8415" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="embedded">true</ac:parameter>
<ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<ac:structured-macro ac:macro-id="7eb7c532-f9f7-4132-b6db-223be71af597" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">mychoice1</ac:parameter>
<ac:parameter ac:name="fieldLabel">My choice 1</ac:parameter>
<ac:parameter ac:name="values">[46566051|addChoices|changeTeam|false|false|]</ac:parameter>
<ac:parameter ac:name="type">smartmultiselect</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="04d80edb-5210-492c-995e-b8d890c84db6" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">mychoice2</ac:parameter>
<ac:parameter ac:name="fieldLabel">My choice 2</ac:parameter>
<ac:parameter ac:name="values">[46566051|addChoices|changeType|true||]</ac:parameter>
<ac:parameter ac:name="type">smartselect2</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="831ce505-61a9-4684-9c42-62cb5f611842" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">SC</ac:parameter>
<ac:parameter ac:name="fieldLabel">SC</ac:parameter>
<ac:parameter ac:name="values">[46566051:addChoices]changeType,</ac:parameter>
<ac:parameter ac:name="type">smartclass</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="8edf3822-4f3e-4d0f-ac1e-f000e228bb12" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="fieldName">mychoice2</ac:parameter>
<ac:parameter ac:name="values">changeTeam:[entry.mychoice1.transform(label).join( OR changeTeam:)]</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>
<p>
<ac:structured-macro ac:macro-id="7abf542e-21be-47c7-9b4e-31013fbfa1f1" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="fieldName">SC</ac:parameter>
<ac:parameter ac:name="values">changeTeam:[entry.mychoice1.transform(label).join( OR changeTeam:)]</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>
</ac:rich-text-body>
</ac:structured-macro>

I was under impression that your teams are also defined as a smart field... but they are just a simple dropdown, and therefore the filtering shall be done by using label (or id, as you have them the same)

Curtis Freudigmann
Contributor
June 13, 2019

Thanks Alex! This is EXACTLY what I was looking for.

 

A quick side question for you looking at this. When you add ( OR changeTeam) in the .join - is this strictly for the concatenation or is OR a keyword as well?

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 19, 2019

I am creating a filter with ORs dynamically

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events