cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
StinkyD01
Helper III
Helper III

Gallery Checkboxes based on Text Input number value

I have a Gallery1 with a Checkbox1. I have built a outside Checkbox2 so I can select ALL and unselect ALL with using a variable called varCheck. Now this gallery can show up to almost 500 rows at a time.  I need to select Checkbox1 in Gallery1 based on the number I provide in a text input box (textinput1). Example: In textinput1, if I put in 100 or 20, I need to have it select the first 100 or 20 checkboxes in Gallery1. Is this possible? Any guidance would be appreciated. I hope this makes sense. Thank you 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yujincui-msft
Community Support
Community Support

Hi @StinkyD01 ,

 

Maybe you could try as below:

 

Set(varCheck,true)
Set(varCheck,false)
If(!IsBlank(TextInput1.Text),Set(varCheckNum,Value(TextInput1.Text)),0)
If(varCheckNum>0&&ThisItem.ID in FirstN(DataSource,varCheckNum).ID,true,If(varCheck,true))

 

vyujincuimsft_0-1664424435662.png

vyujincuimsft_1-1664424444753.png

 

 

Best Regards,

Charlie Choi

View solution in original post

2 REPLIES 2
v-yujincui-msft
Community Support
Community Support

Hi @StinkyD01 ,

 

Maybe you could try as below:

 

Set(varCheck,true)
Set(varCheck,false)
If(!IsBlank(TextInput1.Text),Set(varCheckNum,Value(TextInput1.Text)),0)
If(varCheckNum>0&&ThisItem.ID in FirstN(DataSource,varCheckNum).ID,true,If(varCheck,true))

 

vyujincuimsft_0-1664424435662.png

vyujincuimsft_1-1664424444753.png

 

 

Best Regards,

Charlie Choi

StinkyD01
Helper III
Helper III

Hi @v-yujincui-msft (Charlie Choi),
Thank you so much! This really helped me and it works. I appreciate your time helping me out. Have a good one. 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,606)