survey-creator icon indicating copy to clipboard operation
survey-creator copied to clipboard

A drop-down displays a value instead of display text for a default value when choices are retrieved from a RESTful service

Open JaneSjs opened this issue 1 year ago • 0 comments

T19772 - ChoicesByUrl display during the designer phase https://surveyjs.answerdesk.io/internal/ticket/details/T19772


The issue can be reproduced at https://surveyjs.io/create-free-survey. Configure a drop-down to pull data from a web service:

{
  "pages": [
    {
      "name": "page1",
      "elements": [
        {
          "type": "dropdown",
          "name": "country",
          "title": "Select a country",
          "description": "A full list of countries is queried from a RESTful web service.",
          "defaultValue": "United Arab Emirates",
          "choicesByUrl": {
            "url": "https://surveyjs.io/api/CountriesExample",
            "valueName": "name",
            "titleName": "officialName"
          }
        }
      ]
    }
  ],
  "showQuestionNumbers": "off"
}

Set a default question answer. You can see that the list of options shows display names: image However, a drop-down displays a value instead of a display text on a design surface: image

Expected output: image

JaneSjs avatar Sep 11 '24 10:09 JaneSjs