web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to filter / use 2 ...
Power Apps
Answered

How to filter / use 2 sharepoint lists on a screen

(0) ShareShare
ReportReport
Posted on by 16

Hello!

I'm working on an app to manage leave requests for a company. This app essentially serves as a tool to view, approve and track PTO. The app is primarily powered by a Sharepoint list named "PTO Request2". Im also trying to marry-up a list to show current vacation balances based on the current PTO request in view. This list (for current PTO balances) is called "PTO balances". They each have a field / column name called "Employee" which is driven from Active Directory.

 

My question is, how / what is the appropriate filter to apply to the PTO Balances list to show information based on the user shown in the current selection?

 

Im still getting my feet wet with PowerApps, so any detailed help is more than appreciated

 

Thanks!

 

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,991 Moderator on at

    @ryancrist 

    Welcome to the PowerApps forum 🙂

     

    By reading your post I understand your goal is to build an app for making "paid time-off" requests and you want to show the balance remaining for an employee making the request.  I have an idea about how to do this.  Where is the employee showing on your PowerApp: in a ComboBox?  Is the "Employee" field a "Person or Group" column type in SharePoint?

     

    A screenshot of your app will help.

     

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

  • ryancrist Profile Picture
    16 on at

    Hey and thanks for the reply.

     

    On both the PTO Balance list and the PTO request list, the Employee field is a "person or group" column type. 

     

    I have attached a screen shot showing the two lists .

     

    Thanks!

    Screen Shot 2019-12-31 at 8.45.10 AM.png
  • mdevaney Profile Picture
    29,991 Moderator on at

    @ryancrist 

    We can use the employee email address (which is a unique to each employee) to LOOKUP the remaining balance in a separate SharePoint list.  Here's how to do it:

    Let's assume your Employee ComboBox showing Stacey Chu is called DataCardValue_Employee.  To find the email for Stacey Chu we would use this code.

     

    DataCardValue_Employee.Email

     

    The result would look something like this.

     

    staceychu@yourcompany.com

     

    To get the Remaining Balance for Stacey Chu in your PTO Balance List put this code in the Text property of a label.

     

    LookUp('PTO Balance',Employee.Email=DataCardValue_Employee.Email,'Remaining Balance')

     

    The label will show a number representing the employee's PTO balance that looks like this.

     

    32

     

    Let me know if you any questions about my approach.

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

  • ryancrist Profile Picture
    16 on at

    Thanks for the help!

     

    I modified the datacard value to your suggestion below and applied the other names of my columns. Im getting an error as shown in the attached screen shot. Any ideas how to remedy this?

     

     

    Screen Shot 2019-12-31 at 3.11.15 PM.png
  • Verified answer
    mdevaney Profile Picture
    29,991 Moderator on at

    @ryancrist 

    You appear to be putting the formula into a text input contained within another form.  My solution was not designed for what you are trying to do.  It was meant for a label outside of a form.

     

    Therefore, we must look at this problem differently.

     

    1st, are you sure "PTO balance" is the correct name?  That was just my guess... you'll have to use the real name.

     

    2nd, you might want to reverse your changes and try to modify the Item property of your PTO Balance form instead.  I assume you navigated to the details screen from a Gallery.  You code use this code here in the Item property.

    LookUp('PTO Balance',Employee.Email=Gallery1.Selected.Employee.Email)

     

    My previous code might not work in the Item property but you are welcome to try.

    LookUp('PTO Balance',Employee.Email=DataCardValue_Employee.Email)

     

    Let me know what you tried and what the result was.  Error messages like the one you shared are extremely helpful.

     

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

  • ryancrist Profile Picture
    16 on at

    This is perfect! I ended up using : 

    LookUp('PTO Balance',Employee.Email=Gallery1.Selected.Employee.Email)

     

    I truly appreciate the help!!!

     

    Thank you! 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard