cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
d3ell
Helper V
Helper V

FIND function to get email address from a string

Hi all,

 

I have a record in a table which has various emails connected in a string with  a ';' in between each email address.

 

ie.  example@microsoft.com;example@gmail.com

 

I am wanting to show an icon, only to users who have their email listed in this string,  thought I would be able to use the find function but cannot get this to work - Any thoughts?

 

This is what I have tried...(as well as various other ideas i cant get it to work. ) 

 

 

 

If(User().Email=(Find(User().Email,LookUp(CustomerCareAppDefaults,Title="1",AdminEmail),1,true)

 

 

 

The string of emails is located in the AdminEmail record where Title = "1"

 

Any thoughts?

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @d3ell ,

Do you want to check if the current user's email is existed in the email string?

 

Based on the formula that you mentioned, I think there is something wrong with it. Please consider modify your formula as below (set the OnVisible property of the Icon to following😞

If(
   IsBlank(
            Find(
                 Lower(User().Email),
                 Lower(LookUp(CustomerCareAppDefaults, Title = "1", AdminEmail))
            )
   ),
   false,
   true
)

 

In addition, you could also consider take a try with the following formula:

If(
   Lower(User().Email) in Lower(Trim(Split(
                                LookUp(CustomerCareAppDefaults, Title = "1", AdminEmail), 
                                ";"
                          ).Result)),
   true,
   false
)

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xida-msft
Community Support
Community Support

Hi @d3ell ,

Do you want to check if the current user's email is existed in the email string?

 

Based on the formula that you mentioned, I think there is something wrong with it. Please consider modify your formula as below (set the OnVisible property of the Icon to following😞

If(
   IsBlank(
            Find(
                 Lower(User().Email),
                 Lower(LookUp(CustomerCareAppDefaults, Title = "1", AdminEmail))
            )
   ),
   false,
   true
)

 

In addition, you could also consider take a try with the following formula:

If(
   Lower(User().Email) in Lower(Trim(Split(
                                LookUp(CustomerCareAppDefaults, Title = "1", AdminEmail), 
                                ";"
                          ).Result)),
   true,
   false
)

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi @v-xida-msft 

 

Thanks for your help, I can confirm that the following worked,

If(
   IsBlank(
            Find(
                 Lower(User().Email),
                 Lower(LookUp(CustomerCareAppDefaults, Title = "1", AdminEmail))
            )
   ),
   false,
   true
)

 

and its now in my app.  

 

I'm struggling though to work out why it wouldn't work without the IsBlank and Lower Function, could you advise why this is?

 

the text in all the sources is lower case anyway so it shouldn't need to convert it and there isnt a possibility of this being Blank, i have tried the following, (which is basically the same but removing the IsBlank and Lower functions), but it doesnt work.

If(Find(User().Email), LookUp(CustomerCareAppDefaults, Title = "1", ReportRecipients), false, true )

I know that I have a solution, but in order to get better at PowerApps i'm trying to understand why these are required so that i will hopefully need less help moving forward!

 

Thanks 

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,388)