cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Edit Form - AllowedValues

I have a powerapp pointing to a sql azure table. 

The editform automatically created has textboxed for my text field which makes sense, but I would like some of them to be dropdowns with a handfull of options to pick from.

 

 

On the right pane you can edit the data elements. I am guessing I should change it to 'AllowedValues', but I can't see how to edit the list of values. Maybe I am way off here, but I can't find anything in the documentation for how to do it within a form control.

 

Please help?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Power Apps
Power Apps

Re: Edit Form - AllowedValues

The 'AllowedValues' card is used when the data source itself knows what are all the possible values (for example, an enumeration column in CDM). You can, however, customize the card to change the text input control to another more suitable for your needs, by unlocking the card.

 

Let's walk through it... I'll create an app from data from a SQL table that has a property that I want to restrict the values. Here's the edit screen for it:

01-Form.png

You can notice that the card has a small "padlock" indicating that it's locked and cannot be changed. With the card selected, click the '...' button and then click 'Advanced options':

02-ChooseAdvanced.PNG

Now click the padlock to unlock the card, to be able to change the controls used on it:

03-UnlockCard.PNG

You'll see that the padlock on the card name disappeared. Select the control that you want to delete (the text input). You'll notice that the advanced pane shows the control name (in this case, 'DataCardValue7') - take a note of this name as it will make it easier to correct some errors later.

04-SelectControl.PNG

Now delete the control. You'll notice that there will be some errors in the card, because that control was referenced by others.

05-ControlDeleted.PNG

Now add a new control (Insert -> Dropdown) while the card is selected (so that the control will be added as a child of the card. After adding it, click on the control name, and rename it to the name of the original control (in this example, 'DataCardValue7')

06-InsertAndRenameDropdown.PNG

Now go back to the advanced pane and update the 'Items' property to the list of values that you want to allow. Also update the 'Default' value to 'Parent.Default' so that it will show the current value for the record when it's being edited.

07-UpdateItemsAndDefault.PNG

Finally, select the card, and change its Update property to get the value from the dropdown. In this case, it's set to 'DataCardValue7.Selected.Value'

08-CardUpdateValue.PNG

And now your edit screen only shows the items from the "allowed values" for your scenario.

View solution in original post

4 REPLIES 4
Highlighted
Power Apps
Power Apps

Re: Edit Form - AllowedValues

The 'AllowedValues' card is used when the data source itself knows what are all the possible values (for example, an enumeration column in CDM). You can, however, customize the card to change the text input control to another more suitable for your needs, by unlocking the card.

 

Let's walk through it... I'll create an app from data from a SQL table that has a property that I want to restrict the values. Here's the edit screen for it:

01-Form.png

You can notice that the card has a small "padlock" indicating that it's locked and cannot be changed. With the card selected, click the '...' button and then click 'Advanced options':

02-ChooseAdvanced.PNG

Now click the padlock to unlock the card, to be able to change the controls used on it:

03-UnlockCard.PNG

You'll see that the padlock on the card name disappeared. Select the control that you want to delete (the text input). You'll notice that the advanced pane shows the control name (in this case, 'DataCardValue7') - take a note of this name as it will make it easier to correct some errors later.

04-SelectControl.PNG

Now delete the control. You'll notice that there will be some errors in the card, because that control was referenced by others.

05-ControlDeleted.PNG

Now add a new control (Insert -> Dropdown) while the card is selected (so that the control will be added as a child of the card. After adding it, click on the control name, and rename it to the name of the original control (in this example, 'DataCardValue7')

06-InsertAndRenameDropdown.PNG

Now go back to the advanced pane and update the 'Items' property to the list of values that you want to allow. Also update the 'Default' value to 'Parent.Default' so that it will show the current value for the record when it's being edited.

07-UpdateItemsAndDefault.PNG

Finally, select the card, and change its Update property to get the value from the dropdown. In this case, it's set to 'DataCardValue7.Selected.Value'

08-CardUpdateValue.PNG

And now your edit screen only shows the items from the "allowed values" for your scenario.

View solution in original post

Highlighted
Regular Visitor

Re: Edit Form - AllowedValues

This is great, thanks for the start.  I'm going to keep digging on this because I've already got a SQL table with controlled values to select, and want to create a data connection to draw those into the drop-down, rather than trying to update them inside the PowerApp.

Highlighted
Community Champion
Community Champion

Re: Edit Form - AllowedValues

Ohhhh so that's what enumeration does! I will have to try it

Microsoft Employee
@8bitclassroom
Highlighted
Regular Visitor

Re: Edit Form - AllowedValues

Hi, did you figure out a way to use your SQL table?

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,300)