cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Multi select multi conditions

I have the Form Layed out like this and I would like actions to take place from one field to another like what is indicated in red.

multiBox.PNG

And here is some code I have on one of the circle icons fill colors in the Gallery

 

If(ThisItem.Value = "24 Hour Check" && Value('24HoursEditData'.Text) >= 24,
	RGBA(0,256,0,1),
	If(ThisItem.Value = "100 Hour Check"&&Value('100HoursEditData'.Text) >= 100,
		RGBA(0,256,0,1),
		If(ThisItem.Value = "250 Hour Check"&&Value('250HoursEditData'.Text) >= 250,
			RGBA(0,256,0,1),
			If(ThisItem.Value = "500 Hour Check"&&Value('500HoursEditData'.Text) >= 500,
				RGBA(0,256,0,1),
				If(ThisItem.Value = "3000 Hour Check"&&Value('3000HoursEditData'.Text) >= 3000,
					RGBA(0,256,0,1),
					//you can ignore this
					If(ThisItem.Value = "Check All",RGBA(150,150,150,1),RGBA(150,150,150,1))
				)
			)
		)
	)
)

 

and I want to Set multiple COMBO BOX items based on Hours reached but I don't think I can use for or while loops in Power App, also I don't think I'm lighting up the green arrows in the most efficient way.

Im looking into collection to see if its a viable option for multiple values.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Anonymous ,

Do you want the combo box's selected items change based on the value that you fill in the textinputs?

Actually, I do not think you need to set the gallery so complexly. Building a collection with these textinputs value could make everything easier.

I've made a similar test for your reference:

1)set the screen's OnVisible:

ClearCollect(hoursOfOperation,
{hour:"24 Hour Check",value:Value('24HoursEditData'.Text),result:If(Value('24HoursEditData'.Text)>=24,true,false)},
{hour:"100 Hour Check",value:Value('100HoursEditData'.Text),result:If(Value('100HoursEditData'.Text)>=100,true,false)},
{hour:"250 Hour Check",value:Value('250HoursEditData'.Text),result:If(Value('250HoursEditData'.Text)>=250,true,false)},
{hour:"500 Hour Check",value:Value('500HoursEditData'.Text),result:If(Value('500HoursEditData'.Text)>=500,true,false)},
{hour:"3000 Hour Check",value:Value('3000HoursEditData'.Text),result:If(Value('3000HoursEditData'.Text)>=3000,true,false)})

2)set the textinputs' OnChange:
24 hour textinput:

Patch(hoursOfOperation,LookUp(hoursOfOperation,hour="24 Hour Check"),{value:Value('24HoursEditData'.Text),result:If(Value('24HoursEditData'.Text)>=24,true,false)})

100 hour textinput:

Patch(hoursOfOperation,LookUp(hoursOfOperation,hour="100 Hour Check"),{value:Value('100HoursEditData'.Text),result:If(Value('100HoursEditData'.Text)>=100,true,false)})

250 hour textinput:

Patch(hoursOfOperation,LookUp(hoursOfOperation,hour="250 Hour Check"),{value:Value('250HoursEditData'.Text),result:If(Value('250HoursEditData'.Text)>=250,true,false)})

500 hour textinput:

Patch(hoursOfOperation,LookUp(hoursOfOperation,hour="500 Hour Check"),{value:Value('500HoursEditData'.Text),result:If(Value('500HoursEditData'.Text)>=500,true,false)})

3000 hour textinput:

Patch(hoursOfOperation,LookUp(hoursOfOperation,hour="3000 Hour Check"),{value:Value('3000HoursEditData'.Text),result:If(Value('3000HoursEditData'.Text)>=3000,true,false)})

3)for the gallery, set its Items:

hoursOfOperation

set the icon's fill inside the gallery:

If(ThisItem.result,
RGBA(0,256,0,1),
RGBA(150,150,150,1))

4)for the combo box

set its Items:

hoursOfOperation

set its DefaultSelectedItems:

Filter(hoursOfOperation,result)

 

Then the gallery and combo box will all display based on the value in the textinputs.

611.PNG

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
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

2 REPLIES 2
Anonymous
Not applicable

This does not work

If(IsEmpty(Filter(hoursOfOperation,Text='24HoursEditData'.Text)),
    Collect(hoursOfOperation,'24HoursEditData'.Text),
    Remove(hoursOfOperation,'24HoursEditData')
)

 

Hi @Anonymous ,

Do you want the combo box's selected items change based on the value that you fill in the textinputs?

Actually, I do not think you need to set the gallery so complexly. Building a collection with these textinputs value could make everything easier.

I've made a similar test for your reference:

1)set the screen's OnVisible:

ClearCollect(hoursOfOperation,
{hour:"24 Hour Check",value:Value('24HoursEditData'.Text),result:If(Value('24HoursEditData'.Text)>=24,true,false)},
{hour:"100 Hour Check",value:Value('100HoursEditData'.Text),result:If(Value('100HoursEditData'.Text)>=100,true,false)},
{hour:"250 Hour Check",value:Value('250HoursEditData'.Text),result:If(Value('250HoursEditData'.Text)>=250,true,false)},
{hour:"500 Hour Check",value:Value('500HoursEditData'.Text),result:If(Value('500HoursEditData'.Text)>=500,true,false)},
{hour:"3000 Hour Check",value:Value('3000HoursEditData'.Text),result:If(Value('3000HoursEditData'.Text)>=3000,true,false)})

2)set the textinputs' OnChange:
24 hour textinput:

Patch(hoursOfOperation,LookUp(hoursOfOperation,hour="24 Hour Check"),{value:Value('24HoursEditData'.Text),result:If(Value('24HoursEditData'.Text)>=24,true,false)})

100 hour textinput:

Patch(hoursOfOperation,LookUp(hoursOfOperation,hour="100 Hour Check"),{value:Value('100HoursEditData'.Text),result:If(Value('100HoursEditData'.Text)>=100,true,false)})

250 hour textinput:

Patch(hoursOfOperation,LookUp(hoursOfOperation,hour="250 Hour Check"),{value:Value('250HoursEditData'.Text),result:If(Value('250HoursEditData'.Text)>=250,true,false)})

500 hour textinput:

Patch(hoursOfOperation,LookUp(hoursOfOperation,hour="500 Hour Check"),{value:Value('500HoursEditData'.Text),result:If(Value('500HoursEditData'.Text)>=500,true,false)})

3000 hour textinput:

Patch(hoursOfOperation,LookUp(hoursOfOperation,hour="3000 Hour Check"),{value:Value('3000HoursEditData'.Text),result:If(Value('3000HoursEditData'.Text)>=3000,true,false)})

3)for the gallery, set its Items:

hoursOfOperation

set the icon's fill inside the gallery:

If(ThisItem.result,
RGBA(0,256,0,1),
RGBA(150,150,150,1))

4)for the combo box

set its Items:

hoursOfOperation

set its DefaultSelectedItems:

Filter(hoursOfOperation,result)

 

Then the gallery and combo box will all display based on the value in the textinputs.

611.PNG

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,776)