cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Giulian
Advocate I
Advocate I

IF for Visible Button

Hi

 

My data source is Sharepoint list and i have a button on my apps

I want this button appear only if Datasource.Mail=User().Email) is it possible ? I make many try but i think the IF function don t understand how to compare value of my field to the value of connected user

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @Giulian ,

Could you please share a bit more about the data structure of your SP list?

Do you want to visible the button only when your data source contains current user's email?

 

Based on the needs that you mentioned, I think the LookUp function could achieve your needs. I have made a test on my side, please take a try with the following workaround:

Set the Visible property of the Button to following:

If(
   IsBlank(LookUp('Your SP List', Mail = User().Email)),
   false,
   true
)

Or

If(
   User().Email in 'Your SP List'.Mail,
   true,
   false
)

Please 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

5 REPLIES 5
wyotim
Resident Rockstar
Resident Rockstar

Is Datasource.Mail an explicit value? It could be that you need to get a singlular Mail value from Datasouce, using a LookUp, Filter, or even ThisItem depending on how you are getting that value. 

 

For instance, you could do something like:

/* Check if user email is in the Mail column of Datasource; show button if so, hide it if not */
If(
    IsBlank(
        LookUp(Datasource, Mail = User().Email).Mail
    ),
    false,
    true
)

If you can provide more info about how you are trying to compare Datasource.Mail to User().Email I would be happy to help out with the code if my attempt above doesn't do the trick.

v-xida-msft
Community Support
Community Support

Hi @Giulian ,

Could you please share a bit more about the data structure of your SP list?

Do you want to visible the button only when your data source contains current user's email?

 

Based on the needs that you mentioned, I think the LookUp function could achieve your needs. I have made a test on my side, please take a try with the following workaround:

Set the Visible property of the Button to following:

If(
   IsBlank(LookUp('Your SP List', Mail = User().Email)),
   false,
   true
)

Or

If(
   User().Email in 'Your SP List'.Mail,
   true,
   false
)

Please 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

Sorry i busy for these week, i will try tou re solution this next week

 

My app is a sort of directory of enterprise, where i put in datasource field the mail of the director of each enterprise ( office 365 tenant mail), if the current connected user email is a director email present on the directorty the button for editing form appear, if no the button is not visible you can just read.

 

 

 

 

Hi @Giulian ,

Yeah. Based on the needs that you mentioned, I think the solution I provided above could achieve your needs.

 

If you have solved your problem, please go ahead to click "Accept as Solution" to identify this thread has been 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.

this one is good for me :

 

If(
   User().Email in 'Your SP List'.Mail,
   true,
   false
)

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (69,223)