cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
zmansuri
Super User
Super User

DropDown Add New Choice Value

q20.jpg

So here's the scenario. Subcategory is choice type field. But, i don't know how many choices will be there. So "Add New Subcategory" option should always be first. and selecting it will add new choice to the choice field. 

 

Any ideas how to implement this?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @zmansuri,

Do you want to update the Text column based on ComboBox1.Selected or ComboBox1.SearchText?

Could you please modify your Update property formula as below:

If(
    !(IsEmpty(ComboBox15.Selected) || IsBlank(ComboBox15.Selected)),
    ComboBox15.Selected.Result,ComboBox15.SearchText
  )

Note that your Combo Box15 should not allow multi select.

Best Regards,
Qi

View solution in original post

4 REPLIES 4
CNT
Super User
Super User

@zmansuri You have to sort the Items so that "Add New Subcategory" appears on the top. To do this you may need an additional ID column added to the Items with "Add New Subcategory" having ID as 1.

Hi @CNT  This is what i am trying. Text type column in Sharepoint named Subcategory. In the form i remove text field and add combobox. 

Item property will be: 

Distinct(ListName,Subcategory).Result

Update property of DataCard:

If(!IsEmpty(ComboBox1.SelectedItems),ComboBox1.Selected.Result,ComboBox1.SearchText)

 

Logic is: User will select from existing category. But if category is not there he will enter text in the search part of combobox and save the form. So, next time because of the distinct it will be available to select. I did this for choice field using this code. But, it's not working for Text type.

 

Code that worked for Choice field:

If(Not IsBlank(DataCardValue.Selected),DataCardValue.Selected,{Value: DataCardValue.SearchText; '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"})

@zmansuri Is "Add New Subcategory" also one of the records?

Hi @zmansuri,

Do you want to update the Text column based on ComboBox1.Selected or ComboBox1.SearchText?

Could you please modify your Update property formula as below:

If(
    !(IsEmpty(ComboBox15.Selected) || IsBlank(ComboBox15.Selected)),
    ComboBox15.Selected.Result,ComboBox15.SearchText
  )

Note that your Combo Box15 should not allow multi select.

Best Regards,
Qi

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,796)