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

Non-repeated text input (number input) in gallery view

Dear all,

 

I have 1 gallery that display SharePoint list items. From the gallery, I added 1 text input for user to enter number (rating).

User need to rate which performance is no 1,2,3 etc.

 

If the gallery have 3 items, user need to choose number from 1-3 and enter that number in the text input for each gallery item.

The entered number cannot be repeated in another gallery items, if repeat, the textbox border shows error (red color).

 

The same thing happens if the gallery have 7 items, user need to choose number from 1-7 and the entered number in the text input cannot be repeated.

After entered all value in all textboxes and no error found, user click submit button to update the "rating column" in SharePoint list.

 

Any ideas to solve this?

 

Thank you in advance!

 

Galery.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @shabilass :

Could you tell me :

Does this gif meet your requirements——

84.gif

I'v made a test for your reference.

1\Add a gallery and set it's items property to

 

CustomGallerySample /*it is my data source*/

 

2\Add a textinput box(TextInput3) into this gallery

OnChange

 

RemoveIf(TestCollection,Item in Table(ThisItem)); /*TestCollection is my custom collection*/
Collect(TestCollection,{Item:ThisItem,Input:TextInput3.Text})

 

BorderColor

 

If(
CountRows(Filter(TestCollection,TextInput3.Text=Input))>1 Or Value(TextInput3.Text)>CountRows(CustomGallerySample),/*CustomGallerySample is the gallery's items property*/
Color.Red,
RGBA(0, 18, 107, 1))

 

Best Regards,

Bof

 

View solution in original post

2 REPLIES 2
Community Support
Community Support

Hi @shabilass :

Could you tell me :

Does this gif meet your requirements——

84.gif

I'v made a test for your reference.

1\Add a gallery and set it's items property to

 

CustomGallerySample /*it is my data source*/

 

2\Add a textinput box(TextInput3) into this gallery

OnChange

 

RemoveIf(TestCollection,Item in Table(ThisItem)); /*TestCollection is my custom collection*/
Collect(TestCollection,{Item:ThisItem,Input:TextInput3.Text})

 

BorderColor

 

If(
CountRows(Filter(TestCollection,TextInput3.Text=Input))>1 Or Value(TextInput3.Text)>CountRows(CustomGallerySample),/*CustomGallerySample is the gallery's items property*/
Color.Red,
RGBA(0, 18, 107, 1))

 

Best Regards,

Bof

 

View solution in original post

Hi @v-bofeng-msft 

 

Thank you so much for the guidance! It's working well!

Helpful resources

Announcements
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

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

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Solution Authors
Top Kudoed Authors
Users online (61,063)