cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Thanasis
Advocate II
Advocate II

Navigate to a different page when done

Hello, 

I'm having an issue tying a navigate to a patch. What I'm doing, is I have a button, when clicking on it, it checks first if that user has already submit and answer , if they did it navigates him to a page if they haven't submit an answer yet, it goes and patches some things in a SharePoint list. What I want is after it patches to navigate to certain page. Everything I try it doesn't seems to like it. 

 

If(

    CountRows(

        Filter(

            mylist,

            'Created By'.Email = Office365Users.MyProfileV2().mail

        )

    ) > 0,

    Navigate(ScTryAgain),

    Patch(

        mylist,

        Defaults(mylist),

        {

            'number1': Value(Dropnumber1.SelectedText.Value),

            'number2': Value(Dropnumber2.SelectedText.Valuee),

            'number3': Value(Dropnumber3.SelectedText.Value),

            'number4': Value(Dropnumber4.SelectedText.Value),

            'number5': Value(Dropnumber5.SelectedText.Value),

            'number6': Value(Dropnumber6.SelectedText.Value),

            'number7': Value(Dropnumber7.SelectedText.Valuee),

            'number8': Value(Dropnumber8.SelectedText.Value),

            'number9': Value(Dropnumber9.SelectedText.Value)

        }

    )

);

 

Any help you can provide I would appreciate. Thank you in advance 

1 ACCEPTED SOLUTION

Accepted Solutions

@Thanasis 

Just realized that you wanted to navigate after the Patch.  I had assumed that your first navigate was not working.

In that case, just change your formula to the following:

If(
    CountRows(
        Filter(
            mylist,
            'Created By'.Email = Office365Users.MyProfileV2().mail
        )
    ) > 0,

    Navigate(ScTryAgain),

    Patch(
        mylist,
        Defaults(mylist),
        {
            'number1': Value(Dropnumber1.SelectedText.Value),
            'number2': Value(Dropnumber2.SelectedText.Valuee),
            'number3': Value(Dropnumber3.SelectedText.Value),
            'number4': Value(Dropnumber4.SelectedText.Value),
            'number5': Value(Dropnumber5.SelectedText.Value),
            'number6': Value(Dropnumber6.SelectedText.Value),
            'number7': Value(Dropnumber7.SelectedText.Valuee),
            'number8': Value(Dropnumber8.SelectedText.Value),
            'number9': Value(Dropnumber9.SelectedText.Value)
        }
    );
    Navigate(yourOtherScreen)
)

 

Notice we are just adding another function to the "Else" part of your If statement.  So, once the Patch is done, the next statement will execute.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

4 REPLIES 4
RandyHayes
Super User III
Super User III

@Thanasis 

Your formula appears to be correct (except for two typos in the name Value in number2 and number7).

My question would be, do you actually get a match in your filter?

Put a label on your screen and set the Text property to the following:

CountRows(
    Filter(
        mylist,
        'Created By'.Email = Office365Users.MyProfileV2().mail
    )
)

See if you are actually getting items in your count.

 

I would focus on the email comparison.  Sometimes the case of the Email in SharePoint is different than the case from the 365 email - ex.  Name@domain.com <> name@domain.com

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
VijayTailor
Resident Rockstar
Resident Rockstar

Hi @Thanasis ,

You can Use Like below- 
Code that will Navigate you to another Screen once Patch Done. 

  CountRows(

        Filter(

            mylist,

            'Created By'.Email = Office365Users.MyProfileV2().mail

        )

    ) > 0,

    Navigate(ScTryAgain),

    Patch(

        mylist,

        Defaults(mylist),

        {

            'number1': Value(Dropnumber1.SelectedText.Value),

            'number2': Value(Dropnumber2.SelectedText.Valuee),

            'number3': Value(Dropnumber3.SelectedText.Value),

            'number4': Value(Dropnumber4.SelectedText.Value),

            'number5': Value(Dropnumber5.SelectedText.Value),

            'number6': Value(Dropnumber6.SelectedText.Value),

            'number7': Value(Dropnumber7.SelectedText.Valuee),

            'number8': Value(Dropnumber8.SelectedText.Value),

            'number9': Value(Dropnumber9.SelectedText.Value)

        }

    );UpdateContext({PatchDone:true});

);
If(PatchDone,Navigate(Screen61));

Thanks,
Vijay

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."- Vijay



@Thanasis 

Just realized that you wanted to navigate after the Patch.  I had assumed that your first navigate was not working.

In that case, just change your formula to the following:

If(
    CountRows(
        Filter(
            mylist,
            'Created By'.Email = Office365Users.MyProfileV2().mail
        )
    ) > 0,

    Navigate(ScTryAgain),

    Patch(
        mylist,
        Defaults(mylist),
        {
            'number1': Value(Dropnumber1.SelectedText.Value),
            'number2': Value(Dropnumber2.SelectedText.Valuee),
            'number3': Value(Dropnumber3.SelectedText.Value),
            'number4': Value(Dropnumber4.SelectedText.Value),
            'number5': Value(Dropnumber5.SelectedText.Value),
            'number6': Value(Dropnumber6.SelectedText.Value),
            'number7': Value(Dropnumber7.SelectedText.Valuee),
            'number8': Value(Dropnumber8.SelectedText.Value),
            'number9': Value(Dropnumber9.SelectedText.Value)
        }
    );
    Navigate(yourOtherScreen)
)

 

Notice we are just adding another function to the "Else" part of your If statement.  So, once the Patch is done, the next statement will execute.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Hello @RandyHayes 

 

That worked perfectly. Thank you for your response.

 

@VijayTailor  Thank you for your response. 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,545)