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
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,523)