cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Patron
Post Patron

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
Highlighted
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
Highlighted
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."

Highlighted
Post Patron
Post Patron

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

Lookup has some invalid arguments ?

is the error message.

 

Dave

Highlighted
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."

Highlighted
Post Patron
Post Patron

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))

Highlighted
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))

Highlighted
Post Patron
Post Patron

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

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

 

 

Thanks

Highlighted
Post Patron
Post Patron

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.

 

Highlighted
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
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (10,312)