SOLVED

Can you add dynamic content from another site list to a modern SharePoint page?

Copper Contributor

My classic SP page use a little JS and HMTL formatting to provide Task Order header data for each Task Order subsite. I am finding this difficult to accomplish in a SP modern page. 

The data comes from a SP list (Opportunity Tracker) in the home site and each Task Order is its own subsite, with TO # being the key. You can see from the attached image that the old classic site with dynamic data is on the left and my efforts to roughly accomplish the same thing using a Highlighted Content web part on the right. I managed to get to the list but not inside it. Once I get to the data, then I still have the issue of displaying it. I have seen some 3rd party solutions (Git), but I can't use them. The list filter only seems to use local site lists, so to get the list from the home site I based my current efforts off of Advanced Highlighted Content Web Part | Microsoft Learn but with not much success so far. Any help would be appreciated.

Classic and Modern site pages.PNG



 

3 Replies
best response confirmed by Kevin123 (Copper Contributor)
Solution

Getting closer as I made a SP list view with some JSON view formatting and then URL SP filtered for that one item. I used my iframe to "crop" the top of the list view. Now the last little piece is how do I dynamically get the site name, which is in the site title and the URL, inserted as the filter value for "FilterValue1". Currently I have "FA....2" hardcoded in there.

Kevin123_0-1696369963073.png

 

I think this is what I need to do. I want to display some information from one SP site's lists onto another site - along with other verbiage...the list would need to be filtered for each section.

Do you have the steps you followed or a video that I can follow?
Sorry no video. I figured this out myself. You can learn how to the JSON SP list column formatting here: https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting. Then it is just a matter of calling the list with a filter for one record and adjusting the size of the iframe size within the webpart.
1 best response

Accepted Solutions
best response confirmed by Kevin123 (Copper Contributor)
Solution

Getting closer as I made a SP list view with some JSON view formatting and then URL SP filtered for that one item. I used my iframe to "crop" the top of the list view. Now the last little piece is how do I dynamically get the site name, which is in the site title and the URL, inserted as the filter value for "FilterValue1". Currently I have "FA....2" hardcoded in there.

Kevin123_0-1696369963073.png

 

View solution in original post