Dynamic List Filter based on URL

Brass Contributor

Hi All, 

 

I have the following requirement. 

 

There is a single sharepoint list "Risks" that is inserted into multiple sharepoint pages (one per project ) that will have different url's.

When a user opens a specific project, the sharepoint list should filter to only show list items that were added on that specific page (IE on that project).

 

Based on this, there are two requirements:

 

1. When a user accesses a page, the list should filter based on the url using the "SharepointURL" column. 

2. When a user adds/modified an item, it will automatically add the current url to the "SharepointURL" column so it will only appear on that specific page. 

 

I have tried various sharepoint filter web parts with little success.  

 

Has anyone done something like this before?

 

4 Replies

@Sam_Whitehouse 

 

I will suggest you apply filtering on Project column in list web part if you already have Project column in your list (or create one if necessary).

 

This way each project page will show the items that are associated with that particular project.

 

Check more about filtering list view at: Use filtering to modify a SharePoint view 


Please click Mark as Best Response if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

 

Hi @ganeshsanap,

 

Thankyou for your suggestion, however, I don't believe that would work for us.

 

The user should not have to select the Project as they are already in the project page. The idea is, when the item is added, the SharepointUrl column would get automatically populated based on the page the user is in. 

 

In addition to this, i am assuming this would need a manual filter for the list Everytime a project page is created?  Ideally this would be automatic as project pages will be automatically created also. 

@Sam_Whitehouse I don't think what you want to do is possible as the web part that displays the view of the list list can't be dynamic based on the page the user is on.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

Okay thanks @RobElliott 

 

It does seem odd that there is no Javascript that could do this for us.