cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
m0le
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
v-siky-msft
Community Support
Community Support

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
troytec
Helper I
Helper I

@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.

v-siky-msft
Community Support
Community Support

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

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
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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (10,017)