cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BrunaVieiraPDT
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
v-siky-msft
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
v-siky-msft
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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (43,818)