Answered

How to attach meta data via Webplugins

  • 11 May 2020
  • 3 replies
  • 3099 views

Userlevel 1

I know you can add metadata through the API, but I cannot find documentation on how to add meta data via web plugins, I’d like to add a “session_id” to the group of objects I create via a single button and I need a way to group them up for future use.

icon

Best answer by Falk Kühnel 11 May 2020, 14:40

Hi safis!

It is quite simple, just add the metadata, when you create the widgets. 

const APP_ID = '123456789'; // your app id

miro.board.widgets.create({
type: "image",
url: URL_ROOT + "cards/" + cardName + ".jpg",
metadata: {
[APP_ID]: {
card: true,
cardName: cardName
}
},
x: deck.x,
y: deck.y,
rotation: deck.rotation
})

Have fun!

Falk

View original

3 replies

Userlevel 3
Badge +7

Hi safis!

It is quite simple, just add the metadata, when you create the widgets. 

const APP_ID = '123456789'; // your app id

miro.board.widgets.create({
type: "image",
url: URL_ROOT + "cards/" + cardName + ".jpg",
metadata: {
[APP_ID]: {
card: true,
cardName: cardName
}
},
x: deck.x,
y: deck.y,
rotation: deck.rotation
})

Have fun!

Falk

Userlevel 3
Badge +7

By the way, the “code” item here sucks. It just reformats really badly.

Userlevel 1

ah I did try that once but did it meta_data, welp my years of ruby programming has got the best of me

Reply