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.

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

  1. This works for me except I am having trouble working with the display mode of the Submit button. The manually added value is updating the SP list but the Display mode of the Submit doesn’t like the manually added value. I am using (IsBlank(DataCardValue10.Selected.Value) to make sure the data card value is not blank.

    0
    0
    1. I’m not really sure what you mean. You say that the SP list is updated, but the Submit button doesn’t work? But if your Submit button doesn’t work, how can the SP list be updated? Maybe I need some clarification to understand correctly

      0
      0
  2. Doesn’t work for me, I copy exactly what you are doing (except changing referenced datacard to DataCardValue22):
    If(
    !IsBlank(DataCardValue22.Selected),
    DataCardValue22.Selected,
    If(
    !IsBlank(DataCardValue22.SearchText),
    {
    Value: DataCardValue22.SearchText,
    ‘@odata.type’: “#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference”
    },
    Blank()
    )
    )

    However, the submit button stays disabled (with
    If( IsBlank(DataCardValue22), DisplayMode.Disabled, DisplayMode.Edit)).

    The function would really help me

    0
    0
    1. You should have the .Selected appended to your IsBlank check for the DisplayMode.
      If you are using a multi select column, .Selected won’t work, you should use .SelectedItems instead. Maybe that’s why it’s not working?

      0
      0
    2. No that doesn’t do the trick…

      Without the .Selected it does work for normal choices though.

      With the new option method it doesn’t work with .Selected

      0
      0
  3. Thank you for your formula.
    I realize this formula only allow EITHER selected text OR search TEXT.
    I would like to allow users to manually input values from the multi-select choices.
    Is there anyway that I can allow users to multi-select the current existing choices AND input manual values if any?




    0



    0
    0
    0
    1. That should be possible, but I don’t have the exact solution for you written out. You can just append the selected choice(s) and the manual input into a collection and write that collection back to your SharePoint list.

      0
      0
  4. Thanks so much for the formula!
    But the formula seem to allow either selected text OR manually input text.
    May I ask how should I do if my field is a multi-select choices and I would like to allow users to choose existing choice AND input manual values if there is any?

    0
    0
  5. 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!

    0
    0
    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

      2
      0
  6. 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.

    0
    0
    1. This is SharePoint behavior. If you want to edit or delete custom choices, you must edit/delete them in the SharePoint item where it is entered

      0
      0
  7. 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

    0
    0
    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?

      0
      0
  8. 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.

    0
    0
    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

      0
      0
    2. 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?

      0
      0
    3. Yes, that’s what I tried to say with changing the Update() property of the DataCard. Haven’t played with it yet, so can’t give you the exact solution

      0
      0
    4. 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!

      0
      0
  9. Not sure how I stumbled upon this but it was exactly what I was doing/trying to do. Thanks for posting!

    0
    0
  10. 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!

    0
    0
    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”

              }

      0
      0
    2. So would it look something like:

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

      Value: “Other: ” & DataCardValue2.SearchText,

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

      }

      0
      0
    3. 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

      0
      0
    4. 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

      0
      0
    5. 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

      0
      0
  11. 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?

    0
    0
  12. 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()
    )
    )

    0
    0
    1. Depends on your choice column I guess. If you have multiple choices available it should be SelectedItems. Only one choice can be selected with Selected

      0
      0
  13. 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?

    0
    0
    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!

      0
      0

Leave a Reply

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

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

This site uses Akismet to reduce spam. Learn how your comment data is processed.