cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
DAVIDPOWELL
Level: Powered On

Show a button based on username list in sql server

I have  table called Datatable5 on screen called AccessList

 

the 3rd field has a list of email addresses (usernames)

 

When my App opens to screen2. I want to show a Button only if their username email address is in this datatable  ?

 

Is that possible ?

 

David

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Show a button based on username list in sql server

@DAVIDPOWELL 

That makes sense.  When you said Table I thought you were referring to a SQL table rather than a Table object on the canvas.

View solution in original post

8 REPLIES 8
Super User
Super User

Re: Show a button based on username list in sql server

@DAVIDPOWELL 

Put this code in the OnVisible property of the button on Screen2.

 

!IsBlank(LookUp(AccessList, usernames = User().Email))

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

DAVIDPOWELL
Level: Powered On

Re: Show a button based on username list in sql server

Lookup has some invalid arguments ?

is the error message.

 

Dave

Super User
Super User

Re: Show a button based on username list in sql server

@DAVIDPOWELL 

Given my code below... can you please tell me is there a column named usernames in your SharePoint list?  Is it a Single Line Text data type?

 

!IsBlank(LookUp(AccessList, usernames = User().Email))

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

DAVIDPOWELL
Level: Powered On

Re: Show a button based on username list in sql server

I do not have a sharepoint list...

datatable5 is a sql server table.

 

here is the amended code.

!IsBlank(LookUp(DataTable5, eMail_Column1 = User().eMail))

Super User
Super User

Re: Show a button based on username list in sql server

@DAVIDPOWELL 

Right, you are using SQL as the subject line suggests.  Can you please try changing the code in blue?

 

!IsBlank(LookUp(DataTable5, eMail_Column1 = User().Email))

DAVIDPOWELL
Level: Powered On

Re: Show a button based on username list in sql server

here is the error messagepowerapps4_2020-01-16_14-20-34.jpg

 

 

Thanks

DAVIDPOWELL
Level: Powered On

Re: Show a button based on username list in sql server

ok, I had to make a lookup directly to the sql server table...got the standard delegation warinig, but worked...

 

!IsBlank(LookUp('[dbo].[t_sst_AccessList]', eMail = User().Email))

 

 

only a 10 record list...wont grow much.

 

Super User
Super User

Re: Show a button based on username list in sql server

@DAVIDPOWELL 

That makes sense.  When you said Table I thought you were referring to a SQL table rather than a Table object on the canvas.

View solution in original post

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,389)