cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
amko77
Level: Powered On

Powerapps add new value to choice column

Hi,

 

Does anyone know how to add a new value through powerapps in to the choice column?

This is example of my powerapps form:

 

choice.JPG

 

ChoiceList is one choice column.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Powerapps add new value to choice column

Hi @amko77 ,

Based on the screenshot that you provided, I think you have something wrong with the formula you typed. You have missed some ')' symbol within your fomrula.

 

Please modify your formula as below:

ClearCollect(
             AvailableOptions;
             Choices(TestnaLista.Poslovnica)
);            /* <-- You have missed ')' symbol here . The ';' maybe ';;' on your side */
ForAll(
TestnaLista.Poslovnica;
If(
Poslovnica.Value <> Blank();
Collect(AvailableOptions; Poslovnica.Value)
)
) /* <-- You have missed ')' symbol here */

Please take a try with above formula, then check if your issue is solved.

 

Then set the Items property of the ComboBox within the ChoiceList Data card within your Edit form to following:

Distinct(AvailableOptions, Value)

Best regards,

Community Support Team _ Kris Dai
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

13 REPLIES 13
Anonymous
Not applicable

Re: Powerapps add new value to choice column

Hi

 

What is your items source actually ?

 

Regards,

Louis

amko77
Level: Powered On

Re: Powerapps add new value to choice column

This is my items source:

 

Choices(MyList.ChoiceColumn)

 

I was create Choice column in my sharepoint list and add there some values/data.

Is it possible to add new choice values/data from powerapps?

 

Regards,

 

Amir

Anonymous
Not applicable

Re: Powerapps add new value to choice column

Amir,

 

I think I can't help you on that, but I found this on the forum, I hope that could help you Smiley Happy

 

https://powerusers.microsoft.com/t5/General-Discussion/Adding-More-Options-To-Choice-Column-In-The-P...

 

Louis

Community Support Team
Community Support Team

Re: Powerapps add new value to choice column

Hi @amko77 ,

Could you please share a bit more about your scenario?

Is the ChoiceList column a Choice type coumn in your SP list?

Further, do you want to add new value into this Choice type column in your SP list rather than select from the available options?

 

Based on the needs that you mentioned, if you want to add new value into this Choice type column in your SP list rather than select from the available options, I think you could type the new value within the ChoiceList ComboBox manually, then save it into your SP list.

I have made a test on my side, please take a try with the following workaround:2.JPG

 

3.JPG

Set the Update property of the ChoiceList Data card which contains the ComboBox control to following:

If(
    !IsBlank(DataCardValue14.Selected.Value),
     DataCardValue14.Selected,
     {
         Value: DataCardValue14.SearchText
     }
)

On your side, you should type:

If(
    !IsBlank(YourChoiceListComboBox.Selected.Value),
     YourChoiceListComboBox.Selected,
     {
         Value: YourChoiceListComboBox.SearchText
     }
)

Please check the attached GIF screenshot for more details:Test.gif

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amko77
Level: Powered On

Re: Powerapps add new value to choice column

This is great Smiley Happy

Yes, I have choice type column in my sharepoint list, and I want to have the new value available next time in powerapps choice dropdown list.

 

Your code is really great and work good for entering new value one time.

 

Is it possible that the new value I have entered in to powerapps choice datacard, next time is found in the powerapps dropdown choice list(therefore sharepoint choice column settings list)?

I do not why but your code work for me in this form:

If(
    !IsBlank(DataCardValue1.Selected.Value);
     DataCardValue1.Selected;
     {
         Value: DataCardValue1.SearchText
     }
)

with ; instead ,

 

Sorry about my bad English.

 

Thank you,

 

 

 

Community Support Team
Community Support Team

Re: Powerapps add new value to choice column

Hi @amko77 ,

Do you want the new added value within the ChoiceList ComboBox could also be displayed when you add another new record next time?

 

Currently, within PowerApps, there is no direct way to achieve your needs in PowerApps. As an alternative solution, please consider take a try with the following workaround:11.JPG

 

12.JPG

Set the OnVisible property of the Edit screen to following:

ClearCollect(
AvailableOptions,
Choices('20190325_case13'.ChoiceList)
);
ForAll(
'20190325_case13'.ChoiceList,
If(
ChoiceList.Value<>Blank(),
Collect(AvailableOptions,ChoiceList.Value)
)
)

On your side, you should type:

ClearCollect(
             AvailableOptions, 
             Choices('YourSPList'.ChoiceList)
);
ForAll(
       'YourSPList'.ChoiceList, 
        If(
            ChoiceList.Value <> Blank(),
            Collect(AvailableOptions, ChoiceList.Value)
        )
)

Set the Items property of the ComboBox within the ChoiceList Data card within your Edit form to following:

AvailableOptions

Please take a try with above solution, then check if it could help your scenario.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amko77
Level: Powered On

Re: Powerapps add new value to choice column

Maybe stupid question, but I can not set AvailableOptions on Items for my DatacardValue1(underlined with red). What is AvailableOptions because it is not recognized like function(name is not valid...or recognized like command)?

 

Best Regards,

 

Amir

Community Support Team
Community Support Team

Re: Powerapps add new value to choice column

Hi @amko77 ,

Could you please share a screenshot about the issue within your app?

 

The AvailableOptions that I mentioned is a Collection (a temporary storage of datasource). On your side, you should save your ChoiceList column available options into this collection, and save new added option value (added manually) within your SP list into this Collection.

Note: The OnVisible property of your Edit screen would be fired only when your Edit screen is visible, e.g. navigate to Edit screen from another screen.

More details about Collection in PowerApps, please check the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-clear-collect-clearc...

Set the OnVisible property of your Edit screen to following:

ClearCollect(
             AvailableOptions, 
             Choices('YourSPList'.ChoiceList)   /* <-- ChoiceList reporesents the ChoiceList Choice type column in your SP list */
);
ForAll(
       'YourSPList'.ChoiceList, 
        If(
            ChoiceList.Value <> Blank(),
            Collect(AvailableOptions, ChoiceList.Value)
        )
)

Set the Items property of the ComboBox within the ChoiceList Data card within your Edit form to following:

Distinct(AvailableOptions, Value)       /* <-- Modify here */

 

Please consider take a try with my solution mentioned above step by step, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amko77
Level: Powered On

Re: Powerapps add new value to choice column

I was create collection AvailableOption but when I try to enter code OnVisible - edit screen I have this:

Slika1.JPG

When I change , with ; in this code I have this:

 

Slika2.JPG

 

I was try many combination but every time I have some error in code.

In second picture, every command is active but complete code don't work.

 

Best regards,

Amir

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 405 members 2,918 guests
Please welcome our newest community members: