web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Get Avaialble options ...
Power Pages
Unanswered

Get Avaialble options from an Option Set in Power Pages Portal

(0) ShareShare
ReportReport
Posted on by 120

I am building a page that will display a list of records from a Dataverse table. The tabe includes a 'Status' Choice column.

I would like to display the availilable status with radio buttons, so portal user can click a status to just see the records that match the selected status.

 

The records will be retrieved using fetchXML/liquid, instead of an Entity List, so I can construct the fetchXML based on the selected status, and output the result into a <table> so that I can format it anyway I like.

 

However, I don't seem to be able to find a way to extract the available options from the 'Status' column. I'm trying to get the available options from the column or from the referenced Choice, so that even if the the available options are updated in future I won't need to update code.

 

Some people suggested using fetchXML to query the 'stringmap' table which requires adding table permission for portal users to access. But as it's a system table and Microsoft specifically hides it from the 'Tables' page in make.powerapps.com, I am a bit reluctant to fool around with it.

 

I have investigated the Portal Web API which doesn't have a method to get Option Sets.

The Dataverse Web API does provide a method to do so, but I can't find a way to call it from the Portal.

 

Anyone know the proper way to achieve my requirement? If not, then I will have to hard code the option values and labels into a Content Snippet.

 

Categories:
I have the same question (0)
  • oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    Hi, a few points here:

    • do you need to use custom Fetch? you might able to use OOB Lists + Filters
    • do you need to retrieve the Status? if you are building a custom page using HTML/Liquid, I don't see any issues on hard-coding the status code references in your page, this is not something that will be changing
  • HarrisonSouza Profile Picture
    7 on at

    Thank you, Oliver. I've used the stringmap table with the WebApi and it worked as expected!

  • jlarach07 Profile Picture
    4 on at

    Hi Harrison. I am trying to do the same. Can you please post an example of how you called the stringmap table?

  • HarrisonSouza Profile Picture
    7 on at

    Hi @jlarach07, sure:

     

    To enable the stringmap table for the WebAPI, you must follow the same process you would do for any other table (e.g. account).

    The following is a code sample to retrieve rows from the stringmap table, filtering for the statecode column from the account table:

     async function RetrieveAccountStateCodes() {
     return new Promise((resolve, reject) => {
     webapi.safeAjax({
     type: "GET",
     url: "/_api/stringmaps?$select=attributename,attributevalue,objecttypecode,value&$filter=(objecttypecode eq 'account' and attributename eq 'statecode')",
     contentType: "application/json",
     headers: {
     "Prefer": "odata.include-annotations=*"
     },
     success: function (data, textStatus, xhr) {
     resolve(data)
     console.log(data);
     },
     error: function (xhr, textStatus, errorThrown) {
     console.log(xhr);
     reject(errorThrown);
     }
     });
     });
     }

     

  • jlarach07 Profile Picture
    4 on at

    Thank you @HarrisonSouza! I was able to fetch them from the stringmap table.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard