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

Community site session details

Session Id : e6gYZhBFRdL4edAmueCB8n
Power Apps - Building Power Apps
Answered

If user email = textinput or textinput2, "text"

Like (0) ShareShare
ReportReport
Posted on 19 Jul 2023 15:29:17 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 Moderator on 20 Jul 2023 at 15:02:25
    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 20 Jul 2023 at 07:45:10
    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 Moderator on 19 Jul 2023 at 15:46:34
    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,716 Super User 2025 Season 2 on 19 Jul 2023 at 15:38:14
    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

Announcing our 2025 Season 2 Super Users!

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete