cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Community Support
Community Support

@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

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
Community Support
Community Support

@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

@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)

@BrunaVieiraPDT 

Please check the following screenshot

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

Sik

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
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (4,704)