Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

If user email = textinput or textinput2, "text"

(0) ShareShare
ReportReport
Posted on by

Hi Experts,

 

Need a little help please. I have a bunch of text input boxes that have the default property set as user email addresses. I'm trying to show a heading on a screen depending on which user is accessing it. There are 2 options (different email addresses) for each department. So essentially it should be if the user is user1@domain.com or user2@domain.com then show the heading as Test1 but if the user is user3@domain.com or user4@domain.com then it should show the heading as Test2.

 

What I thought the code would be is as per the below but only one of the input boxes seems to be registering and i'm going mad trying to work this out!

 

If (Lower(User().Email) = Lower(CommercialAndTechSales1.Text) || Lower(CommercialAndTechSales2.Text), "Technical Sales",
If (Lower(User().Email) = Lower(Commercial1.Text) || Lower(Commercial2.Text), "Commercial",
If (Lower(User().Email) = Lower(Sales1.Text) || Lower(Sales2.Text), "Sales",
If (Lower(User().Email) = Lower('R&D1'.Text) || Lower('R&D2'.Text), "R&D",
If (Lower(User().Email) = Lower(QHSE1.Text) || Lower(QHSE2.Text), "Health & Safety / Environmental",
If (Lower(User().Email) = Lower(Production1.Text) || Lower(TestInput.Text), "Production",
If (Lower(User().Email) = Lower(Compliance1.Text) || Lower(Compliance2.Text), "Compliance",
If (Lower(User().Email) = Lower(IT1.Text) || Lower(IT2.Text), "IT"
))))))))

 

Thanks in advance! 

 

Dave

 

 

  • LaurensM Profile Picture
    12,510 Super User 2025 Season 1 on at
    Re: If user email = textinput or textinput2, "text"

    Thank you for the kind words!

     

    Glad I was able to help. 😊

  • Dave-ITMan Profile Picture
    on at
    Re: If user email = textinput or textinput2, "text"

    Hi @LaurensM ,

    Thank you so much, this worked perfectly. Also thank you for the detailed explanation that will certainly help me going forwards. Thanks again! 

  • Verified answer
    LaurensM Profile Picture
    12,510 Super User 2025 Season 1 on at
    Re: If user email = textinput or textinput2, "text"

    Hi @Dave-ITMan,

     

    You have to repeat the full condition twice when using the OR operator '1 = 1 || 1 = 2'.

     

    We can also make some slight adjustments by removing the nested If statements, temporary saving the User().Email function via the With function and replacing the Lower() functions with the In operator. 'In' does not check for exact equals but whether the value is present in the other value - now in cases that the compared values will always be unique (e.g. email) you can use this to avoid the need for Lower() functions. 

     

    With(
     {wEmail: User().Email},
     If(
     wEmail in CommercialAndTechSales1.Text || wEmail in CommercialAndTechSales2.Text,
     "Technical Sales",
     wEmail in Commercial1.Text || wEmail in Commercial2.Text, 
     "Commercial",
     wEmail in Sales1.Text || wEmail in Sales2.Text, 
     "Sales",
     wEmail in 'R&D1'.Text || wEmail in 'R&D2'.Text, 
     "R&D",
     wEmail in QHSE1.Text || wEmail in QHSE2.Text, 
     "Health & Safety / Environmental",
     wEmail in Production1.Text || wEmail in TestInput.Text, 
     "Production",
     wEmail in Compliance1.Text || wEmail in Compliance2.Text, 
     "Compliance",
     wEmail in IT1.Text || wEmail in IT2.Text, 
     "IT"
     )
    )

     

    This setup expects unique values and the TextInput only containing 1 email.

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • Rajkumar_M Profile Picture
    3,631 Super User 2025 Season 1 on at
    Re: If user email = textinput or textinput2, "text"

    Hi,

    Try this

    If( Lower(User().Email) = Lower("user1@domain.com") || Lower(User().Email) = Lower("user2@domain.com"), "Test1", Lower(User().Email) = Lower("user3@domain.com") || Lower(User().Email) = Lower("user4@domain.com"), "Test2", "Default Heading" )

    Thanks!

    If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,658 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard