Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

If formula to navigate to correct screen

(0) ShareShare
ReportReport
Posted on by

Hi Experts,

 

I need a formula on a button that will take the user to the correct screen depending on an IF.

 

If the users email address appears in the 1stApprover column of a sharepoint list & the ChangeStatus of the row item is set to "Submitted" then navigate to MyApprovals screen. I then want the same for 2ndApprover but to navigate to MyApprovals2 screen. Below is where my mind has gone with this code so far but i've made a mistake somewhere along the way, please help

 

If(ChangeMaster, User().Email in '1stApprover') && ((ChangeStatus="Submitted");Navigate(MyApprovals,Cover)

OR

If(ChangeMaster, User().Email in '2ndApprover') && ((ChangeStatus="1st Stage Approved");Navigate(MyApprovals2,Cover)

 

Thanks in advance! 

  • Dave-ITMan Profile Picture
    Dave-ITMan on at
    Re: If formula to navigate to correct screen

    Hi @Drrickryp , @cha_cha , @BideyYusuf 

     

    Thank you all for your help, I tried all and kept getting errors but managed to adapt @Drrickryp slightly using the below which appears to have worked

     

    If(!IsBlank(LookUp(ChangeMaster, User().Email in '2ndApprover' && ChangeStatus="1st Stage Approved")) , Navigate(MyApprovals2,Cover), Navigate(MyApprovals))
  • cha_cha Profile Picture
    cha_cha 4,904 on at
    Re: If formula to navigate to correct screen

    Hello @Dave-ITMan 

     

    There are tons of ways to do this but here's my entry

     

    Navigate(
    If(User().Email in '1stApprover') And ChangeStatus="Submitted",MyApprovals,MyApprovals2),
    Cover)

     

     

  • Verified answer
    Drrickryp Profile Picture
    Drrickryp on at
    Re: If formula to navigate to correct screen

    @Dave-ITMan

    If(!IsBlank(LookUp(ChangeMaster, User().Email in '2ndApprover' && ChangeStatus="1st Stage Approved"}) , Navigate(MyApprovals2,Cover), Navigate(somewhere else)) 

  • BideyYusuf Profile Picture
    BideyYusuf 387 on at
    Re: If formula to navigate to correct screen

    hi @Dave-ITMan 

    It seems you made mistake with "Comma" you used semi-Colon";"  instead of "," and also the bracket.

     

    If(ChangeMaster, (User().Email in '1stApprover') && (ChangeStatus="Submitted"), Navigate(MyApprovals,Cover))
    
    You can also use Lookup
    If(LookUp(ChangeMaster,User().Email in '1stApprover',true)&& ChangeStatus="Submitted",Navigate(MyApprovals,Cover))

     

     Check if this helps.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,691

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 65,019

Leaderboard