cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ttaylor
Level: Powered On

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

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
ttaylor
Level: Powered On

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)

 

 

 

 

 

 

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

Super User
Super User

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

@ttaylor 

Did this resolve your issue?

ttaylor
Level: Powered On

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)

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

ttaylor
Level: Powered On

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.

ttaylor
Level: Powered On

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
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (3,488)