cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

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
Highlighted
Community Support
Community Support

Re: LookUp Function for Data Table in CDS?

Hi @akim91 ,

 

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.
Highlighted
Helper III
Helper III

Re: LookUp Function for Data Table in CDS?

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

Highlighted
Helper III
Helper III

Re: LookUp Function for Data Table in CDS?

bump please

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,220)