cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Using selected value of DropdownList in Function

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
1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

9 REPLIES 9
Microsoft
Microsoft

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).
Anonymous
Not applicable

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

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?

Anonymous
Not applicable

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

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

Anonymous
Not applicable

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

 

 

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.

Anonymous
Not applicable

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?

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

View solution in original post

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (4,003)