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 / Using selected value o...
Power Apps
Answered

Using selected value of DropdownList in Function

(0) ShareShare
ReportReport
Posted on by Microsoft Employee
Hi All, I'm having an issue with an app that I am creating with lots of form controls. I have created a function that sends an HTML email when the user clicks on a button. What I want is for the selected values of dropdownlists to be consumed in this function. When I use the syntax ddllist.selected it says it is an invalid argument. This is clearly incorrect and I wondered if you guys have a better way of achieving this task? Thanks! Joe
Categories:
  • dinusc Profile Picture
    Microsoft Employee on at
    Hello @Anonymous, First of all, can you please confirm if you're indeed using a DropDown control and not a ComboBox control? The ComboBox control is offered by default in forms. Please note that ComboBox.Selected property reference a record, not a field. You will have to add the field name there (example: ComboBox.Selected.Value).
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @dinusc, I am using a dropdown control rather than a combobox control. This is by design as these controls show fixed information such as countries/titles/nationalities

  • dinusc Profile Picture
    Microsoft Employee on at

    Thank you for clarifying. I would still suggest to check if your DropDown.Selected returns a record rather than a field (this depends on the bound source). If you type a period after the "Selected" property, does Web Studio offer a list of field names to select from? Do you see any other errors besides the "Invalid Argument" when attempting to use DropDown.Sleected?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    It does not return anything if I use the selected value. The datasource for these dropdownlists are hard coded for each individual dropdownlist rather than being bound to a datasource such as a SQL table. It doesn't five me a list of field names when I typoe a period after the selected property. It says it's expecting a Text/Number/Boolean value

  • dinusc Profile Picture
    Microsoft Employee on at

    Could you please provide the hard coded data source the DropDown control is bound to?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi,

     

    Here is an example of a dropdownlist used in the app:

     

    Items=["Please Select",
    "Afghan",
    "Albanian",
    "Algerian",
    "American",
    "Andorran",
    "Angolan",
    "Antiguans",
    "Argentinean",
    "Armenian",
    "Australian",
    "Austrian",
    "Azerbaijani",
    "Bahamian",
    "Bahraini",
    "Bangladeshi",
    "Barbadian",
    "Barbudans",
    "Batswana",
    "Belarusian",
    "Belgian",
    "Belizean",
    "Beninese",
    "Bhutanese",
    "Bolivian",
    "Bosnian",
    "Brazilian",
    "British",
    "Bruneian",
    "Bulgarian",
    "Burkinabe",
    "Burmese",
    "Burundian",
    "Cambodian",
    "Cameroonian",
    "Canadian",
    "Cape Verdean",
    "Central African",
    "Chadian",
    "Chilean",
    "Chinese",
    "Colombian",
    "Comoran",
    "Congolese",
    "Costa Rican",
    "Croatian",
    "Cuban",
    "Cypriot",
    "Czech",
    "Danish",
    "Djibouti",
    "Dominican",
    "Dutch",
    "East Timorese",
    "Ecuadorean",
    "Egyptian",
    "Emirian",
    "Equatorial Guinean",
    "Eritrean",
    "Estonian",
    "Ethiopian",
    "Fijian",
    "Filipino",
    "Finnish",
    "French",
    "Gabonese",
    "Gambian",
    "Georgian",
    "German",
    "Ghanaian",
    "Greek",
    "Grenadian",
    "Guatemalan",
    "Guinea-Bissauan",
    "Guinean",
    "Guyanese",
    "Haitian",
    "Herzegovinian",
    "Honduran",
    "Hungarian",
    "I-Kiribati",
    "Icelander",
    "Indian",
    "Indonesian",
    "Iranian",
    "Iraqi",
    "Irish",
    "Israeli",
    "Italian",
    "Ivorian",
    "Jamaican",
    "Japanese",
    "Jordanian",
    "Kazakhstani",
    "Kenyan",
    "Kittian and Nevisian",
    "Kuwaiti",
    "Kyrgyz",
    "Laotian",
    "Latvian",
    "Lebanese",
    "Liberian",
    "Libyan",
    "Liechtensteiner",
    "Lithuanian",
    "Luxembourger",
    "Macedonian",
    "Malagasy",
    "Malawian",
    "Malaysian",
    "Maldivian",
    "Malian",
    "Maltese",
    "Marshallese",
    "Mauritanian",
    "Mauritian",
    "Mexican",
    "Micronesian",
    "Moldovan",
    "Monacan",
    "Mongolian",
    "Moroccan",
    "Mosotho",
    "Motswana",
    "Mozambican",
    "Namibian",
    "Nauruan",
    "Nepalese",
    "New Zealander",
    "Ni-Vanuatu",
    "Nicaraguan",
    "Nigerian",
    "Nigerien",
    "North Korean",
    "Northern Irish",
    "Norwegian",
    "Omani",
    "Pakistani",
    "Palauan",
    "Panamanian",
    "Papua New Guinean",
    "Paraguayan",
    "Peruvian",
    "Polish",
    "Portuguese",
    "Qatari",
    "Romanian",
    "Russian",
    "Rwandan",
    "Saint Lucian",
    "Salvadoran",
    "Samoan",
    "San Marinese",
    "Sao Tomean",
    "Saudi",
    "Scottish",
    "Senegalese",
    "Serbian",
    "Seychellois",
    "Sierra Leonean",
    "Singaporean",
    "Slovakian",
    "Slovenian",
    "Solomon Islander",
    "Somali",
    "South African",
    "South Korean",
    "Spanish",
    "Sri Lankan",
    "Sudanese",
    "Surinamer",
    "Swazi",
    "Swedish",
    "Swiss",
    "Syrian",
    "Taiwanese",
    "Tajik",
    "Tanzanian",
    "Thai",
    "Togolese",
    "Tongan",
    "Trinidadian or Tobagonian",
    "Tunisian",
    "Turkish",
    "Tuvaluan",
    "Ugandan",
    "Ukrainian",
    "Uruguayan",
    "Uzbekistani",
    "Venezuelan",
    "Vietnamese",
    "Welsh",
    "Yemenite",
    "Zambian",
    "Zimbabwean"]

     

    Thanks,

    Joe

     

     

  • dinusc Profile Picture
    Microsoft Employee on at

    Thank you.

    As previously suggested, the DropDown returns a record as the selected item, so you will have to indicate the field name. Here is the result of my test done with your test data set:Capture.PNG

     The DropDown control references a record. Since you provide hard coded values (that are not records), PowerApps implies one automatically (named Value).

    Holpe this helps.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    That seems to have worked! With the Office365.Sendmail function is it possible to control the HTML formatting to include h1, strong etc or is that not supported?

  • Verified answer
    dinusc Profile Picture
    Microsoft Employee on at

    You could provide the formatting options in your message body. FoorExample: "<H2>&MyMessage&</H2>"

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 381 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 340

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard