cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

need help with redirecting user to another screen from a submit button

Dear PowerApps Users,

 

I have a screen where there is a option for users to enter comments, and a submit button having a patch formula as below (to write back to a SharePoint List, once the submit button is pressed) : 


ForAll(Collection1,
If(
LookUp('Approvals Extract',UniqueID= Collection1[@UniqueID],"OK") = "OK",
Patch('Approvals Extract',LookUp('Approvals Extract',UniqueID=Collection1[@UniqueID]),
{'Manager1 Approval Status':"Query",'Manager1 Rejected Reason':TextInput1_4.Text})));
Clear(Collection1)

 

Once the user press "submit" the following should happen

 

1) The text entered in textbox should clear

2) The user should be redirected to the main screen "SCREEN1"

 

I tried to add the navigate functionality within the "If" loop but it keeps giving syntax errors. Please help

 

vas1980_0-1650971022498.png

 

 

1 REPLY 1
Drrickryp
Super User
Super User

@Anonymous 


If(!IsBlank(
            LookUp(
                   'Approvals Extract',UniqueID= Collection1[@UniqueID],"OK"
            )
    ), Patch(
             'Approvals Extract', 
              LookUp(
                     'Approvals Extract',UniqueID=Collection1[@UniqueID]
              ), {'Manager1 Approval Status':"Query",
                  'Manager1 Rejected Reason':TextInput1_4.Text}
        ), 
     false
 );
If(            // check if there were any errors when the patch was submitted
   !IsEmpty(
            Errors('Approvals Extract')
     ),                        
     Notify("submission failed", NotificationType.Error),  // if true, show any error message
     Clear(Collection1)
)

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (1,352)