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

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
Microsoft v-siky-msft
Microsoft

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

BrunaVieiraPDT
Level: Powered On

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
Microsoft v-siky-msft
Microsoft

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

BrunaVieiraPDT
Level: Powered On

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)

Microsoft v-siky-msft
Microsoft

Re: Insert value for each selected option

@BrunaVieiraPDT 

Please check the following screenshot

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

Sik

BrunaVieiraPDT
Level: Powered On

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
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (10,028)