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

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

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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

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

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (81,919)