How to connect custom spfx web part to List web part using dynamic data?

karolis.stoncius 41 Reputation points
2022-03-23T15:19:46.447+00:00

Hi, I have two web parts: first is a simple List and second is my custom spfx web part for displaying item's data. I'm trying to connect these two web parts so that when an item from the list is selected, my web part would display its properties (just like the "List properties" web part). However, I can't figure out how to achieve that using dynamic data. When connecting two custom web parts, everything works fine, but I need to connect the already provided List web part with my custom web part.

What I have so far:

  • Added source selection: 186194-image.png
  • Connected my web part to the source (Listas1): 186126-image.png
  • Tried to get the "getRowData" property: 186158-image.png
  • The "getRowData" is some function which when called returns an error: 186185-image.png

Am I doing something wrong or this is simply not possible?
Any help is appreciated :)

Microsoft 365 and Office | SharePoint | Development
Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments
{count} votes

Answer accepted by question author
  1. RaytheonXie_MSFT 40,496 Reputation points Microsoft External Staff
    2022-03-24T02:20:02.353+00:00

    Hi @karolis.stoncius ,
    Per my research, We are unable to connect custom spfx web part to List web part using dynamic data. We can only connect two or more custom SPFx webpart by dynamic data. For the OOB list, we cannot write custom code with it. You could use the OOB List properties web part to connect it. We can only connect OOB webparts between each other. However there is no such function to connect a custom SPFx webpart to the OOB webparts. Here is the similar issue link
    https://learn.microsoft.com/en-us/answers/questions/307847/how-can-we-connect-listwebpart-present-on-modern-p.html


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.