cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Manually add values to choice type field in Sharepoint Online list

I'm trying to create an app from a custom list in Sharepoint Online and have hit my head on a couple items.  First was the ability to upload pictures from the app as an attachment to the list, found out that isn't a supported thing yet, the second which I need help on is I have a choice column and I need the ability for people to manually add values to the field if the one they aren't looking for is there.  I can do it in the Sharepoint form but haven't seen how I can make that work in PowerApp.  I have pre-populated some choices which it sees in the drop down but when I type something that isn't in the choices it doesn't take the new value and blanks it out.

 

Help...

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Manually add values to choice type field in Sharepoint Online list

Hi @tmezz,

 

If here you mean the Fill-in Choice type, then currently this is not supported under PowerApps.

We could manually patch the self defined value into the Choice field, but only the pre-defined value would shown as available value under PowerApps choice dropdown.

 

To Manually add Choice field, we need take use of the following formula (for update purpose):

 

Patch(ChoiceList,
SingleItemRecord,
{CHoice4:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Id:-1,Value:"News"}
}
)

The fill-in data won't be added as the pre-defined value, it will be listed as another data list.

To workaround this, we could add a TextInput together with the Dropdown, with a button to choose whether it is needed to enter a custom value.

Following the steps below:

1. Unlock the Choice DataCard for editng, add a TextInput control, two button controls, and Rename it to TextInput1, Button1, Button2,

2. Under the OnSelect property of the Button1, copy and paste the following:

UpdateContext({CustomValue:true})

Change its Text property to 

 

"Custom"

Change its Visible property to:

If(CustomValue,false,true)

Change OnSelect property of Button2 with the following formula:

UpdateContext({CustomValue:false})

And Text property to:

"Default"

Change its Visible Property to:

CustomValue

 

3. Modify the Visible property of the TextInput control to:

CustomValue

Modify the Visible property of the Default Dropdown to:

If(CustomValue,false,true)

4. Modify the Update property of the Choice DataCard with the formula below:

If(CustomValue,
{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Id:-1,Value:TextInput1.Text},
DataCardValue16.Selected)

5. Modify the Save Icon formula as below:

SubmitForm(EditForm1);UpdateContext({CustomValue:false})

Screenshots as a reference:

1.PNG2.PNG

 

Post back if you have any further questions.

Regards,

Michael

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Highlighted
Community Support
Community Support

Re: Manually add values to choice type field in Sharepoint Online list

Hi @tmezz,

 

If here you mean the Fill-in Choice type, then currently this is not supported under PowerApps.

We could manually patch the self defined value into the Choice field, but only the pre-defined value would shown as available value under PowerApps choice dropdown.

 

To Manually add Choice field, we need take use of the following formula (for update purpose):

 

Patch(ChoiceList,
SingleItemRecord,
{CHoice4:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Id:-1,Value:"News"}
}
)

The fill-in data won't be added as the pre-defined value, it will be listed as another data list.

To workaround this, we could add a TextInput together with the Dropdown, with a button to choose whether it is needed to enter a custom value.

Following the steps below:

1. Unlock the Choice DataCard for editng, add a TextInput control, two button controls, and Rename it to TextInput1, Button1, Button2,

2. Under the OnSelect property of the Button1, copy and paste the following:

UpdateContext({CustomValue:true})

Change its Text property to 

 

"Custom"

Change its Visible property to:

If(CustomValue,false,true)

Change OnSelect property of Button2 with the following formula:

UpdateContext({CustomValue:false})

And Text property to:

"Default"

Change its Visible Property to:

CustomValue

 

3. Modify the Visible property of the TextInput control to:

CustomValue

Modify the Visible property of the Default Dropdown to:

If(CustomValue,false,true)

4. Modify the Update property of the Choice DataCard with the formula below:

If(CustomValue,
{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Id:-1,Value:TextInput1.Text},
DataCardValue16.Selected)

5. Modify the Save Icon formula as below:

SubmitForm(EditForm1);UpdateContext({CustomValue:false})

Screenshots as a reference:

1.PNG2.PNG

 

Post back if you have any further questions.

Regards,

Michael

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Regular Visitor

Re: Manually add values to choice type field in Sharepoint Online list

Thanks Michael.  I'll give that a go and see how it plays.  Any idea if this is on the roadmap to be supported or do I need to make a request?

 

Thanks again.

 

Tony

Highlighted
Helper I
Helper I

Re: Manually add values to choice type field in Sharepoint Online list

Hello @v-micsh-msft , I am working on a similar item. Is it possible to save custom filled-in data along with selected items from combo box - both together to the SharePoint list? What should be the formula that needs to go into the "Update" property of Combo box data card? Please note multiple selection is allowed on the combo box.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,098)