cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Insert value for each selected option

Hi,

So I'm having quite an headache trying to figure out a way to resolve this situation. I have a SharePoint list wich I made into a form in Power apps and one of the columns is multiple choice. What I want to do is to insert a value for each option of this column. As you can see in the attachments, I have the "tipo de reembolso" data card wich is the multiple choice one and the "valor do reembolso" data card that for now is just the sum of the other seven datacards on the left. I was trying to put each value on them and then submit only the sum on the list/ form, but is not very easy to understand(from the user's view). 

 

How can I do this in a better way?

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Insert value for each selected option

@BrunaVieiraPDT 

Do you mean If you select two items, just put two corresponding values to the left boxes?

The most understandable way is to enter values in tabular form. please this workaround.

1. Set OnChange property of Combo box as below:

 

Clear(MyCol);ForAll(DataCardValue41.SelectedItems,Collect(MyCOl,{Color:Value,NO:Blank()}));
Reset([@TextInput1]);Reset([@TextInput2]);Reset([@TextInput3]);Reset([@TextInput4]);Reset([@TextInput5]);Reset([@TextInput6]);Reset([@TextInput7]);

 

2. Add a DataTable in the 'valor do reembolso' card, set Items property to MyCol

3. Move the seven text box on the NO column, adjust the alignment

4. Set each Text box visible property

TextInput1: CountRows(MyCol)>=1

TextInput2: CountRows(MyCol)>=2

TextInput3: CountRows(MyCol)>=3

TextInput4: CountRows(MyCol)>=4

TextInput5: CountRows(MyCol)>=5

TextInput6: CountRows(MyCol)>=6

TextInput7: CountRows(MyCol)=7

5. Set the Default of each Text box:

If(CountRows(DataCardValue1.SelectedItems)=0,"")

Note: DataCardValue1 is the combo box display name.

StoG_23.gif

Sik

View solution in original post

Highlighted
Helper I
Helper I

Re: Insert value for each selected option

Hey, sorry for the late reply. I managed to make it work. So for those who haven't solved a similar problem with the @v-siky-msft 's solution (very well explained, thanks you're awesome), here's how I did it. I placed a listBox with the Combobox selected items in items and for each text box I did similar by placing a countRow. I don't know if the explanation was clear enough, but I will leave some prints and the functionality of the app.

View solution in original post

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: Insert value for each selected option

@BrunaVieiraPDT 

Do you mean If you select two items, just put two corresponding values to the left boxes?

The most understandable way is to enter values in tabular form. please this workaround.

1. Set OnChange property of Combo box as below:

 

Clear(MyCol);ForAll(DataCardValue41.SelectedItems,Collect(MyCOl,{Color:Value,NO:Blank()}));
Reset([@TextInput1]);Reset([@TextInput2]);Reset([@TextInput3]);Reset([@TextInput4]);Reset([@TextInput5]);Reset([@TextInput6]);Reset([@TextInput7]);

 

2. Add a DataTable in the 'valor do reembolso' card, set Items property to MyCol

3. Move the seven text box on the NO column, adjust the alignment

4. Set each Text box visible property

TextInput1: CountRows(MyCol)>=1

TextInput2: CountRows(MyCol)>=2

TextInput3: CountRows(MyCol)>=3

TextInput4: CountRows(MyCol)>=4

TextInput5: CountRows(MyCol)>=5

TextInput6: CountRows(MyCol)>=6

TextInput7: CountRows(MyCol)=7

5. Set the Default of each Text box:

If(CountRows(DataCardValue1.SelectedItems)=0,"")

Note: DataCardValue1 is the combo box display name.

StoG_23.gif

Sik

View solution in original post

Highlighted
Helper I
Helper I

Re: Insert value for each selected option

@v-siky-msft 

I've tried but nothing seems to work, I also tried to do it different but nothing work. This formala has shown less error then the others.(attachments)

Highlighted
Community Support
Community Support

Re: Insert value for each selected option

@BrunaVieiraPDT 

Please check the following screenshot

Snipaste_2020-02-05_09-30-54.png

Sik

Highlighted
Helper I
Helper I

Re: Insert value for each selected option

Hey, sorry for the late reply. I managed to make it work. So for those who haven't solved a similar problem with the @v-siky-msft 's solution (very well explained, thanks you're awesome), here's how I did it. I placed a listBox with the Combobox selected items in items and for each text box I did similar by placing a countRow. I don't know if the explanation was clear enough, but I will leave some prints and the functionality of the app.

View solution in original post

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

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,845)