Hello Mohsen,
As you have already noticed, the openModal method in the SDK does NOT support passing data. You can use board metadata to store the string there and then read it from the modal:
Write to the board metadata:
await miro.board.metadata.update({'<YOUR_APP_ID>': {"data": "hello"}}
Read from the board metadata:
await miro.board.metadata.get()
Another option would be to use the broadcastData() method:
https://developers.miro.com/docs/the-windowmiro-object#section-broadcast-data
and the listen to the BROADCAST_DATA event:
https://developers.miro.com/docs/namespace-sdk#section-event-type
However, the BROADCAST_DATA event is experimental and I have found it to not be very reliable. We are in the process of building a more robust solution.
I hope this helps.
Daniela
Thank you Daniela,
Unfortunately await miro.board.metadata.get() is also experimental. Since I’m building a production ready app I can’t use something that may change at any moment.
The the interactions of my users require a large screen, so I really need to open modal, and I have to pass the data to the modal,.. I got stuck here.
Oh I realized that writing to metadata and then reading it from modal is prone to concurrency issues.