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

Filter table based on date range from two SharePoint lists

First issue:

I've created a table where I want information from the Notes SharePoint list to filter based on date range: 

     Filter(Notes, FollowUpDate >= DatePicker1.SelectedDate <= DatePicker2.SelectedDate)

THE ERROR is after the column name "FollowUpDate"

 

Second Issue:

How can I pull information from a second table. Example:

   ORGANIZATION (SP List1)      FOLLOW-UP NOTES (SP List2)   

 

the information appearing in the table would be just the two columns, based on the date range selected from the filter.

 

THANK YOU!!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Filter table based on date range from two SharePoint lists

@ttaylor 

Typically the 'A column name already exists error would occur when you try to add columns that already exist.  However, we are adding the columns NZI Lead and Organization here so I am not sure why it is complaining about OrganizationNOTES.  Maybe the event that triggers to build the collection must be restarted (e.g. button click, app restart).

 

ClearCollect(
    myJoinedTables,
    AddColumns(Notes,
        "NZILead",LookUp(NetZero,Organization=Organization.Value).NZILead,
        "Organization",Organization.Value
    )
)

 

You would add the Filter by doing this.  But of course, the OrganizationNOTES problem must be solved first.

 

ClearCollect(
    Filter(
        myJoinedTables,
        AddColumns(Notes,
            "NZILead",LookUp(NetZero,Organization=Organization.Value).NZILead,
            "Organization",Organization.Value
        ),
    FollowUpDate >= DatePicker1.SelectedDate,
    FollowUpDate <= DatePicker2.SelectedDate
    )
)

View solution in original post

12 REPLIES 12
Highlighted
Super User
Super User

Re: Filter table based on date range from two SharePoint lists

@ttaylor 

For issue #1 you can solve it by defining multiple criteria within the filter function

 

Filter(Notes, FollowUpDate >= DatePicker1.SelectedDate, FollowUpDate <= DatePicker2.SelectedDate)

 

---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

Highlighted
Super User
Super User

Re: Filter table based on date range from two SharePoint lists

@ttaylor 

You'll need to share more info to get a useful response for question #2

 

  • What column type is Organization in SPList1?
  • What column type is Organization in SPList2?
  • Please share sample data from both tables
  • Please share your desired result
Highlighted
Helper III
Helper III

Re: Filter table based on date range from two SharePoint lists

Organization (SP1) - single-line text

OganizationNOTES (SP2) - LookUp to SP1 Organization

 

I also need it to reference a name from SP1 (NZILead) - single-line text

NZILeadNOTES - LookUp to SP1 (NZILead)

 

 

 

 

 

 

Highlighted
Super User
Super User

Re: Filter table based on date range from two SharePoint lists

@ttaylor 

You'll need to replace your_SP1_datasource_name and your_SP2_datasource_name in the code I provided but I've tested on my sid and this should work assuming I understood your column names correctly.

 

ClearCollect(
myJoinedTables,
AddColumns(your_SP2_datasource_name,
"NZILead",LookUp(your_SP1_datasource_name,Organization=Organization.Value).NZILead,
"OrgName",Organization.Value
)
)

 

---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

Highlighted
Super User
Super User

Re: Filter table based on date range from two SharePoint lists

@ttaylor 

Did this resolve your issue?

Highlighted
Helper III
Helper III

Re: Filter table based on date range from two SharePoint lists

I'm getting an error that says: A column named 'OrganizationNOTES' already exists. Below is what I have:

 

ClearCollect(
myJoinedTables,
AddColumns(Notes,
"NZILead",LookUp(NetZero,Organization=Organization.Value).NZILead,
"Organization",Organization.Value
)
)

 

ALSO, can I add the filter to this expression for the dates?

 

Filter(Notes, FollowUpDate >= DatePicker1.SelectedDate, FollowUpDate <= DatePicker2.SelectedDate)

Highlighted
Super User
Super User

Re: Filter table based on date range from two SharePoint lists

@ttaylor 

Typically the 'A column name already exists error would occur when you try to add columns that already exist.  However, we are adding the columns NZI Lead and Organization here so I am not sure why it is complaining about OrganizationNOTES.  Maybe the event that triggers to build the collection must be restarted (e.g. button click, app restart).

 

ClearCollect(
    myJoinedTables,
    AddColumns(Notes,
        "NZILead",LookUp(NetZero,Organization=Organization.Value).NZILead,
        "Organization",Organization.Value
    )
)

 

You would add the Filter by doing this.  But of course, the OrganizationNOTES problem must be solved first.

 

ClearCollect(
    Filter(
        myJoinedTables,
        AddColumns(Notes,
            "NZILead",LookUp(NetZero,Organization=Organization.Value).NZILead,
            "Organization",Organization.Value
        ),
    FollowUpDate >= DatePicker1.SelectedDate,
    FollowUpDate <= DatePicker2.SelectedDate
    )
)

View solution in original post

Highlighted
Helper III
Helper III

Re: Filter table based on date range from two SharePoint lists

No luck! I tried restarting, looked at info that takes a user to that page, deleted the table and started from scratch, etc. I'm still getting the OrganizationNOTES error. That is a field in my Notes SP List the is a LookUp field to Organization in my NetZero SP list. However, the only columns pulling info from the Notes list is are KeyThemes, FollowUpDate, FollowUpNotes, MtgNotes and MtgDate.

Highlighted
Helper III
Helper III

Re: Filter table based on date range from two SharePoint lists

Should have finished my thoughts...

 

I have a column in my Notes (SP2) called NZILeadNOTES that is a LookUp to NZILead in NetZero (SP1)

Then Notes (SP2) has OrganizationNOTES that is a LookUp to Organization in NetZero (SP1)

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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