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

Help me Navigate( out from ForAll( loop

I have gallery in my app where users have to provide names. 
Capture4.PNG
Thank to help in some other topic I manage to made the names field mandatory. 

But unfortunately due the some PowerApp functionality and mine personal not understanding it I can't Navigate( out to the next screen if user successfully fill the name fields. I would be helpfully for any directions:

 

Set(BookingDate, Text(Now()+1,"[$-en-US]dd/mm/yyyy"));

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Help me Navigate( out from ForAll( loop

Hi @m0le ,

 

try this:

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

Note: I am assuming that TextInput2 is where you are reading name on the gallery.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Proud to be a Super User!

Regards,
KrishnaV
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

View solution in original post

5 REPLIES 5
Highlighted
Super User
Super User

Re: Help me Navigate( out from ForAll( loop

Hi @m0le ,

 

try this:

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

Note: I am assuming that TextInput2 is where you are reading name on the gallery.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Proud to be a Super User!

Regards,
KrishnaV
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

View solution in original post

Highlighted
Super User
Super User

Re: Help me Navigate( out from ForAll( loop

Hi @m0le ,

You seem to have your logic backwards, but it would be something like the below

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

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Highlighted
Super User
Super User

Re: Help me Navigate( out from ForAll( loop

@m0le 

Put this code in the OnSelect property of your Submit button directly after your current code..  It will check for any blanks in the Text property of each Text Input before navigating to the next screen.

 

 

If(!(Blank() in Gallery1.AllItems.TextInput.Text), Navigate(your_screen_name))

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Highlighted
Helper II
Helper II

Re: Help me Navigate( out from ForAll( loop

Thanks, that worked form me

Highlighted
Super User
Super User

Re: Help me Navigate( out from ForAll( loop

Hi @m0le ,

 

I am happy that your issue got resolved, would you min mark the relevant reply mark as a solution so that the new members of the community.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Proud to be a Super User!

Regards,
KrishnaV
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

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.

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
Users online (4,714)