In Microsoft/SharePoint Lists, there is a type of column, Choice, that can be created in any list or library. There is a setting here in the column settings, called Can add values manually. When this setting is turned on, when someone is filling out the form on the list, they can pick one of the drop-down options, but they can also type whatever they’d like. The problem, is that when using Power Apps, the user’s free-form “other” option does not get saved. When using the default form on the list, it works fine, and the new option gets added to the list of drop-down options. If the list has been customized with Power Apps, or is being used in any Power Apps form control, this functionality does not work. In this post, I’ll show you a solution to this issue. First, here is a screenshot of the setting that I’m referring to:
The form looks like this. Mine is a vey simple form with only a couple of columns, and in the list’s default form, it works fine, and lets you type any new option manually:
Since this functionality is not built-in when the form is customized with Power Apps, here is how you can go about setting it up to work this way, in your app.
- In your SharePoint list, be sure to create a choice column, and check the box next to the setting Can add values manually.
- In your SharePoint list, click Integrate at the top, and choose Power Apps -> Customize forms. Alternately, you could do all of these same steps if you have a standalone Power App instead.
- Rename the combo box for your list of choices. Name it cmbPickSomething
4. Select the card for your choice field, and go to the Update property of the card. Be sure to select the card, not the combo box this time.
5. Click on the Advanced tab on the right panel, and click Unlock to change properties, to unlock the card.
6. In the Update property, clear it out and replace with this code:
If( IsBlank( cmbPickSomething.Selected ), {Value: cmbPickSomething.SearchText}, cmbPickSomething.Selected )
7. Save and close your app.
Try it out! Back in your List / app, fill out a brand new form, and instead of selecting one of the drop-down options, just type something different in the combo box. Save. Notice that whatever you type in the combo box, will be saved to your form, even if it’s not something in the list of choices!
How does it work? The logic in the code is such that if something is not selected from the drop-down, save the value that has been typed in the combo box, which is referred to via the property called SearchText. Note to always double check that the IsSearchable setting for the combo box is set to True.
Would you like to learn more about Power Apps? Check out the training courses that I have created at iwmentor.com.