web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / If user email = textin...
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

 

 

Categories:
I have the same question (0)
  • Rajkumar_M Profile Picture
    3,747 Moderator on at

    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.

  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    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!

  • Dave-ITMan Profile Picture
    on at

    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! 

  • LaurensM Profile Picture
    12,516 Moderator on at

    Thank you for the kind words!

     

    Glad I was able to help. 😊

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 426

#2
WarrenBelz Profile Picture

WarrenBelz 381 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 315 Super User 2026 Season 1

Last 30 days Overall leaderboard