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

Announcements

News and Announcements icon
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,189 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,027

#2
Valantis Profile Picture

Valantis 644

#3
11manish Profile Picture

11manish 626

Last 30 days Overall leaderboard