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 Apps / Dynamically add Option...
Power Apps
Unanswered

Dynamically add Options in Attributes(datatype - choice)

(1) ShareShare
ReportReport
Posted on by 3
Dear Community,



I want to call MyWebsite API and fetch the list of some dropdown values, then put them in an Attibute of Choice Datatype in Dataverse Table. Can you please tell me how can I achieve that?



Detailed steps I want to achieve - 

1. Call My Website API (mywebsite.com/b2bapi/v2/functions/options)

2. Output of MyWebsite API - 
 
{
    "data": [
        {
            "name": "Chemicals",
            "id": 1412
        },
        {
            "name": "Engineering, Procurement and Construction",
            "id": 1553
        },
        {
            "name": "Finance/Banking",
            "id": 1414
        }]
}

3. Add 'name' and 'id' in 'Label' and 'Value' respectively in Dropdown Options(below screenshot)




Note: I don't want to add the options manually.
I have the same question (0)
  • ivan_apps Profile Picture
    2,187 Moderator on at
    Is this a one-time operation you are trying to do? Or are you expecting to do this every time a page loads and needs to view this dropdown?
     
    If you are dynamically changing the values based on other fields in the form, i dont recommend using calling your API to populate your dropdown. Instead load all possible options into your dropdown and filter them using javascript. There is are .removeOption() and .addOption() functions in JS.
     
    If this is a one-time data load of options, you could use a C# console app to do this using the XRM Sdk. You should be able to create a field or global optionset and set the options. But my follow up would be that if you have more than 10 options, and have dynamically changing criteria - is there a reason you arent loading this data into another table and using a Lookup to reference it? There are PCF controls that can make the lookup look like a dropdown if thats the issue.

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 759 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 310 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 228

Last 30 days Overall leaderboard