Question T6240
Visible to All Users

how to load dropdown with post method api with survey creator in surveyjs

created 4 years ago

Hi Team,
In survey creator wanted to bind choices of dropdown from web API, but API method is POST which required parameter as JSON body. Please help.

Show previous comments (2)

    Hello,

    It's simply:

    JavaScript
    question.choices = [1, 2, 3, 4, 5]; // where is that you get via the "POST" request

    Here is the working sample - https://plnkr.co/edit/cYoawNqpeJWeK9nf . The "setTimeout" function emulates async call to a web service.

    Thanks, Serge
    SurveyJS Team

      Hi Team,
      I want to add choices at creator using POST API.

        Hello,
        Please explain your task. POST in server API commonly uses to post/store data on the server.
        What does it mean "add choices at Creator", I don't understand either.

        Thank you,
        Andrew
        SurveyJS Team