1
0
-1

Hi,

I have a state dropdown list in my form. I used inbuild widget from composer for state dropdown. I am getting value from a rest service. When I assign the values for state in prefill service, on-page load the values for state is not getting populated. Other field values are getting populated. Having issue on populating values to custom dropdown list widgets available in composer. Any help please.

Thanks,

 

  1. Glenn Crook

    Does the value you are setting to the drop down match the data value for the drop down? The data value and the display value can be different, some state drop downs use state codes, acronyms, etc, eg US state of Alaska uses the code AK. You can see this on the Data category in the field properties if it is not a dynamically populated drop down.

CommentAdd your comment...

1 answer

  1.  
    1
    0
    -1

    Hi Glenn, I have used a readily available custom widget from composer for State dropdown. which is having values and display values as in screenshot. I tried with both value and displayed value hard-coded in groovy , but the passed value from groovy is not getting populated on page lot. I don't understand why the highlighted value are appended in the dropdown. Any suggestion how to resolve this issue? 

    1. Glenn Crook

      While this looks strange, it is actually fairly simple when you look at it on one line like below:
      $IF{${use.state.code},AL|AK|...|WV|WI|WY,${displayvalues}} which uses the format $IF{condition,truevalue,falsevalue} and the condition is the value from the property use.state.code which in this case is the checkbox above the dropdown data options and if it is then it uses the code list otherwise it uses the property displayvalues which is the list below values in the screenshot.

      With regards to your issue, are you able to put the value in one text field and add another that gets the dropdown and compare the values to make sure that the text and the case match?

    2. Umakanta Dalai

      Thanks Glenn, It helped

    CommentAdd your comment...