confiform Dropdown value only capturing ID instead of value
Asked by Kyng Star:

Hi there,

I can capture dropdown ID and see what is select but the text associated isn't getting captured.

code:

\</p\>  
\<p style="text-align: left;"\>  
\<ac:structured-macro ac:macro-id="bd35e788-aa36-470a-99d7-4a8b0d92405c" ac:name="confiform-field-definition" ac:schema-version="1"\>  
\<ac:parameter ac:name="fieldName"\>pTitle\</ac:parameter\>  
\<ac:parameter ac:name="fieldLabel"\>Incident Title\</ac:parameter\>  
\<ac:parameter ac:name="validationMessage"\>Please remove any double quotes from the "Incident title" field.\</ac:parameter\>  
\<ac:parameter ac:name="type"\>text\</ac:parameter\>  
\<ac:parameter ac:name="required"\>true\</ac:parameter\>  
\<ac:parameter ac:name="validation"\>\^\[\^"\]\*$\</ac:parameter\>  
\</ac:structured-macro\>  
\</p\>

\<p style="text-align: left;"\>  
\<ac:structured-macro ac:macro-id="06e8293e-8d82-46aa-b580-79fb1b615a56" ac:name="confiform-field-definition" ac:schema-version="1"\>  
\<ac:parameter ac:name="fieldName"\>pSite\</ac:parameter\>  
\<ac:parameter ac:name="fieldLabel"\>Site Location\</ac:parameter\>  
\<ac:parameter ac:name="values"\>false\[1=New York\|2=London\|3=Mumbai\|4=OTHER\|5=Hongkong\|\]\</ac:parameter\>  
\<ac:parameter ac:name="extras"\>label;false\</ac:parameter\>  
\<ac:parameter ac:name="type"\>select\</ac:parameter\>  
\<ac:parameter ac:name="required"\>true\</ac:parameter\>  
\</ac:structured-macro\>  
\</p\>  
\<p\>  
\<ac:structured-macro ac:macro-id="c4cf4bf0-fa0b-4237-9410-99d49046b385" ac:name="confiform-field" ac:schema-version="1"\>  
\<ac:parameter ac:name="fieldName"\>pTitle\</ac:parameter\>  
\<ac:parameter ac:name="withLabel"\>true\</ac:parameter\>  
\<ac:parameter ac:name="showLabelOnOwnLine"\>true\</ac:parameter\>  
\</ac:structured-macro\>  
\</p\>  
\<p\>  
\<ac:structured-macro ac:macro-id="9aaf00c1-65f0-4dd1-80ef-9fccc39fae61" ac:name="confiform-field" ac:schema-version="1"\>  
\<ac:parameter ac:name="fieldName"\>pSite\</ac:parameter\>  
\<ac:parameter ac:name="withLabel"\>true\</ac:parameter\>  
\<ac:parameter ac:name="showLabelOnOwnLine"\>true\</ac:parameter\>  
\</ac:structured-macro\>  
\</p\>

\<ac:structured-macro ac:macro-id="bfb91a82-744b-4065-a598-71cf242ac443" ac:name="confiform-ifttt" ac:schema-version="1"\>  
\<ac:parameter ac:name="action"\>Create JIRA Issue\</ac:parameter\>  
\<ac:parameter ac:name="extras"\>FAST JIRA\</ac:parameter\>  
\<ac:parameter ac:name="event"\>onCreated\</ac:parameter\>  
\<ac:parameter ac:name="resultName"\>key\</ac:parameter\>  
\<ac:rich-text-body\>  
\<p class="auto-cursor-target"\>  
\<br/\>  
\</p\>  
\<ac:structured-macro ac:macro-id="4622bb5e-a4e9-4a82-b602-d230815bbec6" ac:name="noformat" ac:schema-version="1"\>  
\<ac:plain-text-body\>\<!\[CDATA\[{  
"fields":{  
"project":{  
"key":"INC"  
},  
"summary":"\[entry.pTitle\]",  
"description":"h3.LOCATION DETAILS \\n \\n \*Location:\* \[entry.pSite\] \\n\\n ",  
"issuetype":{  
"id":"3"  
}  
}  
}\]\]\>\</ac:plain-text-body\>  
\</ac:structured-macro\>


Answers:
author: Alex Medved _ConfiForms_
body: Hi

When you use \[entry.pSite\] you access the value stored within ConfiForms and that is ID, and never a "label"

To get a label you need to put

\[entry.pSite.label\]

As per <https://wiki.vertuna.com/display/CONFIFORMS/Accessing+field+values+and+properties>

Alex


Tags: confiforms