Using manual SharePoint fill-in choice values in your PowerApp

If you’re using a SharePoint choice field you can set the ‘Allow fill-in choices‘ (or ‘Can add values manually‘ in modern) option to yes.

This will give users the opportunity to manually specify a value for the choice field if the given values are not sufficient. E.g. when a user want to request a brush, but the only available choices are:

  • Pencil
  • Paper
  • Ruler
  • Eraser

The user can manually specify ‘brush’ and that will be saved to the list:

But when you create a PowerApp and select that same field, users won’t be able to manually specify a value anymore:

In this blog, I will explain how you can allow fill-in choices within your choice fields in PowerApps.

SharePoint configuration

First of all, you will need a choice column that allows fill-in choices (obviously). That’s the only thing you need to configure in SharePoint.

PowerApps configuration

Your PowerApps configuration takes a little more effort. There are multiple ways to achieve this and I will explain it by using the SearchText property.

First, you need to make sure the ‘Allow searching‘ option is enabled (which is by Default) on the choice field in your PowerApp by selecting your dropdown control and enabling Allow searching in the Properties pane.

With that option enabled, users are able to search the dropdown by entering a value which will search for that specific value. Since your have user input with this option, you can also use this to store that value into your list item. You can achieve this by adding the following function to the Update() property of your DataCard:

If(
    !IsBlank(DataCardValue2.Selected),
    DataCardValue2.Selected,
    If(
        !IsBlank(DataCardValue2.SearchText),
        {
            Value: DataCardValue2.SearchText,
            '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
        },
        Blank()
    )
)

Breaking this down into smaller pieces:

  • If(!IsBlank(DatacardValue2.Selected),DatacardValue2.Selected will check if there is a value selected in the dropdown. If so, this value will be used to store within the item.
  • If(!IsBlank(DatacardValue2.SearchText) if there is no value selected in the dropdown, this will check if there is a value entered manually by the user, using the SearchText property.
    • If so, this value will be stored, using the following record value: {Value: DataCardValue2.SearchText,’@odata.type’: “#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference”}
    • If not, a blank value will be stored using the Blank() function. If your choice field is set to Required, this will make sure no empty value will be stored. If your choice field is not required, you can skip the second If() statement and just enter the record value as stated above as your false expression.

When you have everything into place, your fill-in choice is ready for use:

You can also configure an ‘Other’ choice value and when that value is selected, a text-box appears where users can enter their value manually. This may be a bit more user friendly, but also a bit more configuration on the PowerApps side. Please contact me if you want to know more about that solution.

25 Replies to “Using manual SharePoint fill-in choice values in your PowerApp”

  1. Thanks for this helpful post!

    The solution works fine for single select dropdowns but doesn’t handle multiselect. Do you have any idea regarding multiselect options with fill in?

    1. I see your previous comment now. Replying in the wrong chronological order isn’t quite handy:). But you’re right. SelectedItems for multiselect and Selected for single select!

  2. It’s just “SelectedItems” ?

    If(
    !IsBlank(DataCardValue14.Selected);
    DataCardValue14.SelectedItems;
    If(
    !IsBlank(DataCardValue14.SearchText);
    {
    Value: DataCardValue14.SearchText;
    ‘@odata.type’: “#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference”
    };
    Blank()
    )
    )

  3. As a browser of a sharepoint site, I should be able to select a Choice, and see all related files with that Choice including in all sub-folders.

    Currently this is not possible, when selecting a Choice I only see the files in the current folder.

    Is there something I can reconfigure to get my expected behaviour?

  4. Great Article!

    I like that this does not update the “Choice Column” in SharePoint, but the manually entered choices are staying in the choices selection within the Power App. I tested with multiple users and they can see entries that are manually entered. I do not want these there permanently. Is there a way to clear them out?

    Thanks!

    1. Yes, you should update your Items property of your choice field from Choices(…) to Filter(Choices(…),Not(‘…’ in Value)) where ‘…’ should be something you add to the manual value (prefix or suffix). This will filter out all manual entries .

      I use ‘Other: ‘ as prefix in my lists.

      Make sure to append this prefix or suffix when submitting your form:

      {

                  Value: “Other: ” & DataCardValue2.SearchText,

                  ‘@odata.type’: “#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference”

              }

      1. So would it look something like:

        Filter(Choices(…),Not(‘Other:’ in Value))
        {

        Value: “Other: ” & DataCardValue2.SearchText,

        ‘@odata.type’: “#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference”

        }

        1. You should use the Filter() function on your dropdown control to filter out the ‘Other: ‘ values
          The {Value: … } is used inside the Update() property of your DataCard to write the custom value to your list

          1. But the end user does not want to append any word before or after the manual choice..so in this case, how can we prevent the dropdown to display the manually filled in choice value

          2. You can introduce a second choice field that only contains the custom choice and it not visible by the end user (not included in views and hidden in content type), but in this case it does contain the prefix. You can then conpare both values to see if it’s a custom value

  5. My new choice is recorded on the list but the choice options are not updated.

    My new choice is only recorded if it is the only value in the multiple-selections. If multiple choices are submitted with a new choice, only the existing choices are recorded.

    1. That can be right. My solution only describes the method of updating the manual choice of nothing else is selected in the dropdown.
      If you want to add the manual choice when you also have selected an option, you should change to Update() property of your DataCard because now it only updates the manual value if there is nothing selected. You should do a check on whether a value is selected AND text is also filled

      1. Wouldn’t you also need to change the formula though? Would you have to set the ‘Value’ to concatenate the Selected.Items [Item] and the SearchText value?

          1. Hi Des, i’m currently facing this issue now with multiple selects! Is it possible for you to share the formula you’ve figured out? Thanks so much!

  6. This is working for me, but how can I make it just accept the fill-in value but not SAVE it in the list? I added test1 and test2, now both show up at the bottom of the list for users to select. I want them to be able to add fill in choices but for them not to save

    1. Let me get things clear.
      Do you want users to be able to save their custom entry to the list and not be able to select it later on or don’t you want them to be able to save the custom entry at all?

  7. Is there a way to edit the custom choices that are saved to the field? I do want the default action to save any custom values, but I would like to be able to manage them by deleting them. Custom choices saved in PowerApps are not added as values in the Column.

  8. I am interested in your configuration to address:

    “You can also configure an ‘Other’ choice value and when that value is selected, a text-box appears where users can enter their value manually. This may be a bit more user friendly, but also a bit more configuration on the PowerApps side. Please contact me if you want to know more about that solution.”

    I apologize if you’ve already posted the solution here – I must have missed it.

    Thanks!

    1. The SharePoint configuration is basically the same for this: you need a choice field that allows fill-in choices. You only need to add a new choice value: Other
      The difference lays within the Power App. Instead of storing the SearchText, you need to configure a text box next to your dropdown. This textbox becomes visible when you select Other from your dropdown.
      Visible attribute of your textbox: If(DataCardValue1.Selected.Value=”Other”,true,false)

      Now, you also need to change the Update attribute of your DataCard to make sure the value of the textbox will be saved to your field when Other is selected and the textbox is not empty:
      If(
      DataCardValue1.Selected.Value = “Other”,
      If(
      Not(IsBlank(textbox.Text)),
      {
      ‘@odata.type’: “#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference”,
      Id: 1,
      Value: Concatenate(
      “Other: “,
      textbox.Text
      )
      }
      ),
      DataCardValue1.Selected
      )

      I hope this helps you, please let me know

Leave a Reply

Your email address will not be published. Required fields are marked *