1

Is there a way to fetch all the Choice Options of a Choice Field created in a SharePoint Online List and to display in a custom SharePoint Page(Inside Pages Library/Site Pages)?(Without the help of any web parts).

I am creating a Poll with graphical representation using JQuery and JavaScript.

I need to display Poll questions in a custom made page.

The questions of the Poll should come from a SharePoint list and the options(Answer list of the Poll) would be fetched from a choice field say Radio button type from the same list. All the choice field options should be displayed for the users to select while participating in the poll.

1
  • How are you adding JS/jQuery to modern page or are you using classic pages? Apr 26 at 17:24

1 Answer 1

1

As you are using JavaScript and jQuery, you can use SharePoint REST API to fetch the choices/options from choice column in SharePoint list.

You have to use the REST endpoint like:

/_api/web/lists/GetByTitle('List Name')/fields?$filter=EntityPropertyName eq '<Choice Field Internal Name>'

Where <Choice Field Internal Name> is the internal name of your choice column. You can get the exact internal name of your column by following this article: How to find the Internal name of columns in SharePoint Online?

Check below threads for complete code:

  1. I am trying to get the choice type field value in select tag from SharePoint list
  2. REST API get choice values from column in ascending
2
  • 1
    Hi Ganesh, It worked! I am able to fetch all options from choice field. Great help! Thanks Apr 27 at 7:43
  • 1
    You're welcome, glad it worked for you! Apr 27 at 8:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.