How to Create a Dropdown With Other Option in Power Apps?

Recently, I was required to create a Power Apps form from SharePoint named Employee Leave Requests, which has a leave type choice column. While submitting the leave requests, employees might have other leave-type reasons, which I haven’t included in the choice column.

So, in the Power Apps form, I was required to create an “Other” option in the Power Apps dropdown control. Then, employees could choose that option and provide their own reasons.

This article will show how to create an Other option in the Power Apps dropdown control.

Create a Dropdown With Other Option in Power Apps

I have an employee leave request form in Power Apps, as shown in the example below. In the form, the leave type is a dropdown that contains SharePoint list leave type choice field values. If the leave type doesn’t match the provided values while submitting the leave request, I take an “Other” option; when they select it, the text input control will be visible to provide the leave type.

After submitting the form, the newly entered value will be updated to the SharePoint list choice field.

create power apps dropdown with other option

Look at the SharePoint list choice values below.

how to add other option to power apps dropdown control

The SharePoint list has the following fields.

Column NameData Type
Employee NamePerson
Leave TitleSingle line of text
Leave TypeChoice
DepartmentChoice
Start DateDate & Time
End DateDate & Time
Manager NameSingle line of text

Follow the steps below to achieve this!

1. In Power Apps, connect that SharePoint list. Then, add an Edit form control from the +Insert tab. Provide the formula below in its DataSource property.

'Employee Leave Requests'
how to create a dropdown with an other option in power apps

2. We can add an “Other” option to the leave type data card value in two ways: by providing any of the below formulas in its items property.

Hardcoded :

["Sick Leave","Annual Leave","Compassionate Leave","Maternity","Other"]

Formula:

Ungroup(
Table({DropdownOptions: Choices('Employee Leave Requests'.LeaveType)},
{DropdownOptions: ["Other"]}
),
"DropdownOptions"
)
powerapps dropdown with other option

3. To provide data while selecting the “Other” option, add a text input control in the Leave Type Data card within the form control. Provide the formula below for its visible property to make it visible only when we select that option.

If(DCV_LeaveType.Selected.Value="Other",true,false)
how to add other option in power apps dropdown

4. Add the formula below to the Update property of the “Leave Type” data card in the Power Apps form.

If(DCV_LeaveType.Selected.Value="Other",{Value:txt_leaveType.Text} ,DCV_LeaveType . Selected)

This formula updates the text input control value if we select the “Other” option. For remaining values, the selected leave type is updated.

powerapps add other option to dropdown manually

5. Add a button control to submit the Power Apps form data to the SharePoint list. Then, add the formula below in its OnSelect property.

SubmitForm(frm_EmpLeave);
Notify(
    "Details Submitted Succesfully",
    NotificationType.Success
);
NewForm(frm_EmpLeave);
create a dropdown with an other option in power apps

6. Save the changes and preview the application once. In the example below, you can see I selected the Other option for the leave type and provided the leave type in the text input control. After clicking the submit button, the data is stored in the SharePoint list.

power apps dropdown control with other option

7. If you’re using the patch function to update the data in these fields in the SharePoint list, use the code below in the submit button control’s OnSelect property.

Patch(
    'Employee Leave Requests',
    Defaults('Employee Leave Requests'),
    {
        'Employee Name': cmb_Employee.Selected,
        'Leave Title': txt_LeaveTitle.Text,
        'Leave Type': If(
            DCV_LeaveType.Selected.Value = "Other",
            {Value: txt_leaveType.Text},
            {Value: DCV_LeaveType.Selected.Value}
        ),
        Department: {Value: cmb_dept.Selected.Value},
        'Start Date': dtp_startdate.SelectedDate,
        'End Date': dtp_enddate.SelectedDate,
        'Manager Name': txt_managername.Text
    }
)

Here,

  • Employee Leave Requests = SharePoint list name
  • cmb_Employee = combo box control name that contains employee names.
  • txt_LeaveTitle = Text input control name for leave title field.
  • DCV_LeaveType = Dropdown control name that contains leave type choice values.
  • cmb_dept = Combo box control name that contains department values.
  • dtp_startdate = Date picker control name for start date.
  • dtp_enddate = Date picker control name for end date.
  • txt_managername = Text input control name that stores manager name.

This way, we can save the Power Apps’ individual control data to the SharePoint list using the Patch function.

I hope you understand how to add other options to the Power Apps dropdown control. In this article, I also explained how to save the other options data to the SharePoint list with the submit form function and patch function.

Follow this article while you also try to add other options to the Power Apps dropdown control that meet your requirements.

Also, you may like:

>