cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

LookUp Function for Data Table in CDS?

To give the community a background, I am currently working on customizing the Leave Request template app. Instead of using the OneDrive Excel file for leave banks, I am trying to utilize our SQL Server database which has this information. I pulled that data into the CDS, which I used to populate a Data table in PowerApps.

 

How can I use the LookUp function so that when users use this application, it will only show their own unique leave banks? I do not want users to be able to see other employee leave banks at all.

 

So far, the formula I have is: LookUp(BALANCES1S_3, Office365Users.userid(_myProfile.Id));

 

This seems totally incorrect... where do I plug the correct formula? Is it on the OnVisible for LoginScreen?

 

Thank you in advance!

3 REPLIES 3
v-yamao-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please use Filter function instead of Lookup function.

I assume that you will display all the info on a gallery.

Here I have made a test based on SharePoint list, please check it for a reference.

First, create a connection to SharePoint list. There is a column for employee email address.

Then add a gallery control, set its Items property with the following function:

Filter(List11,EmployeeName.Email=User().Email)

Then it will only display the items related to the current user.

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

hi @v-yamao-msft 

 

I was wondering if you are familiar with the Leave Request template provided by Microsoft? In the LeaveBalanceScreen, the GalleryLeaveBalance uses the RequesterBalanceCollection with what the template provided. I'm trying to add my own different types of balances (9 different kinds). I was successful in changing the LeaveTypeCollection.

 

How can I change the RequesterBalanceCollection so that it'll reflect a unique individual's balance? I have a SQL Server table that currently lists every employee we have along with their own balances.

 

Thanks,

Alex

Anonymous
Not applicable

bump please

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

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

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

Top Solution Authors
Top Kudoed Authors
Users online (41,911)