How to create a Choice / Select box in widget SP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2020 10:54 PM
Hi,
I want to create Choice type field in widget and add choice values with the values
I get the name from the integrations as shown below::
Thailand,Japan,Singapore,Nepal,Malaysia,Canada,Australia,Australia,Australia,Cambodia,Sri Lanka,Germany,Finland,United Arab Emirates,Philippines,India,Italy,Sweden,Spain,Australia,Belgium,Egypt,Australia,Lebanon,Iraq,Oman,Afghanistan,Bahrain,Kuwait,Algeria,Croatia,Switzerland,Austria,Israel,Pakistan,Brazil,Georgia,Greece,North Macedonia,Norway,Romania,Estonia,San Marino,Belarus,Iceland,Lithuania,Mexico,New Zealand,Nigeria,Australia,Ireland,Luxembourg,Monaco,Qatar,Ecuador,Azerbaijan,Armenia,Dominican Republic,Indonesia,Portugal,Andorra,Australia,Latvia,Morocco,Saudi Arabia,Senegal,Argentina,Chile,Jordan,Ukraine
Now what ever the names i received i want to display in the choice values. Can anyone please help me on this

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2020 11:16 PM
Hi,
Using option schema you can create Choice type field and add the value in it.
Go through below the doc it will help you.
Thanks,
Kunal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2020 11:26 PM
Hi
I cant create a Option schema because i dont have any table, i am getting a result from an integration, so what ever names i received i just need to add as choice values in the widget

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2020 03:19 AM
Hi,
You have to create a array in server script and then use ng-repeat in html script as below:
HTML:
<tr ng-repeat="report in data.reports | orderBy:c.sort.sortType:c.sort.sortReverse | filter:c.sort.searchReports">
<td>{{report.number}}</td>
<td>{{report.display_name}}</td>
<td>{{report.producer}}</td>
<td>{{report.director}}</td>
<td style="text-align:right">
</td>
</tr>
Server Script:
Thanks,
Ashutosh Munot