Skip to main content
Phil_Dunphy
June 23, 2024
Solved

Syncing Two Widgets

  • June 23, 2024
  • 5 replies
  • 321 views

I am developing two different widgets in two separate folders and I am trying to sync the data in both widgets together. From Widget A, I can press a “Send” button and it will send the data from Widget A to Widget B and navigate directly to wherever Widget B is at. But I want Widget B to automatically fetch and display the data from Widget A as soon as I navigate to Widget B using

Figma.currentPage.selection = [WidgetB]
Figma.viewport.scrollAndZoomIntoView([WidgetB]);

Right now after I have navigated to Widget B, I have to create and click on a “Fetch” button in Widget B in order to fetch and display the updated data. I have tried setting up event listener to trigger the fetch function, but I assume the Widget B is not in an “active state” when I navigate from Widget A to Widget B that why the event listener isn’t triggered. Is there any solution to solve this issue, this is my first Figma widget project and I have been trying to solve this for days, any help would be really appreciated.

This topic has been closed for replies.
Best answer by Gleb

Unfortunately a widget can’t trigger another widget. User action is required.

5 replies

Phil_Dunphy
June 23, 2024

Any better alternative or workaround suggestions are welcomed as well. Thank you.

Gleb
GlebSolution
Power Member
June 23, 2024

Unfortunately a widget can’t trigger another widget. User action is required.

Phil_Dunphy
June 23, 2024

Alright, thanks for clarifying. Just for future reference,
A) Is there any way I can open the Widget B directly from within Widget A, for example through clicking a button.

B) Is there any way to create a brand new widget with completely different component design, functions and property menu from within another widget. Or is it better to create two different widgets instead.

Gleb
Power Member
June 24, 2024

No

No, widgets can’t create other widgets

Phil_Dunphy
June 24, 2024

Okay that’s helpful, thank you once again.