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

TextInput as mandatory in gallery

Hi Guys 

I have gallery from a collection where i require from user to fill it up with the names. 
Capture4.PNG

 


I am trying to make TextInput in the gallery a mandatory so i add the code to the button

 

 

If(
    !IsBlank(TextInput2.Text),
       ForAll
            (GalChoiceDeskMulti.AllItems,Patch(MultiDeskSelection,LookUp([@MultiDeskSelection], Subtitle4.Text=DeskNumber ),
            {UserName: TextInput2.Text,
            UserID: UserIDVariable})),
            Notify("Names are mandatory",NotificationType.Warning)
            
    
)


It`s only working when all TextInput fields are empty.

When one is fill and the other is not it`s pass the test. 

Any clues please ?  

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: TextInput as mandatory in gallery

Hi @m0le ,

 

Please try this:

If(
       IsEmpty(Filter(GalChoiceDeskMulti.AllItems,IsBlank(TextInput2))),
       ForAll
            (GalChoiceDeskMulti.AllItems,Patch(MultiDeskSelection,LookUp([@MultiDeskSelection], Subtitle4.Text=DeskNumber ),
            {UserName: TextInput2.Text,
            UserID: UserIDVariable})),
            Notify("Names are mandatory",NotificationType.Warning)
)

Hope this helps.

Sik

View solution in original post

3 REPLIES 3
Highlighted
Helper I
Helper I

Re: TextInput as mandatory in gallery

@m0le 

 

The ForAll needs to be outside the check also so that it checks all the gallery records textinputs.

 

Right now You are doing one check and if any have text inside, the patch takes place.

Highlighted
Community Support
Community Support

Re: TextInput as mandatory in gallery

Hi @m0le ,

 

Please try this:

If(
       IsEmpty(Filter(GalChoiceDeskMulti.AllItems,IsBlank(TextInput2))),
       ForAll
            (GalChoiceDeskMulti.AllItems,Patch(MultiDeskSelection,LookUp([@MultiDeskSelection], Subtitle4.Text=DeskNumber ),
            {UserName: TextInput2.Text,
            UserID: UserIDVariable})),
            Notify("Names are mandatory",NotificationType.Warning)
)

Hope this helps.

Sik

View solution in original post

Highlighted
Helper II
Helper II

Re: TextInput as mandatory in gallery

It`s working great thank you for the help, 
I am just struggling with other thing here. 
How do I navigate to next screen when successful ? 
I can`t add && behind path function 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

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

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (12,299)