2: update an item's properties with `sync()`
In the second task of the guided onboarding, you modify and then update board items with the sync()
method.
Time to complete
~5 minutes
Learning objective
After completing this onboarding task, you'll be able to:
- Initiate and manage updates to board items using the
sync()
method.
Let’s update the properties of a board item and see the changes take place.
Action: update your sticky note
-
On the same Miro board you created or opened in task 1, use the developer console to:
-
Update your sticky note's color to light blue.
-
Change your sticky note's position to x = 100, y = 100.
ℹ️ Note
Updates require two steps:- Change the property value.
- Call
sync()
on the item to make the changes effective.
Example
Update a sticky note's properties:// First, you change the values of the properties you want to update. stickyNote.content = 'Updated sticky note'; stickyNote.style.fillColor = 'light_blue'; stickyNote.x = 100; stickyNote.y = 100; // Second, you sync the item to make the changes effective. await stickyNote.sync();
-
-
Run
sync()
to see the updates reflected on the board.
Let's wrap up
In this onboarding task, you:
- Updated the properties of an existing item on a Miro board, using the
sync()
method.
Now that you've updated your sticky note, let's run an app inside a Miro board!
See also
Updated 3 days ago
In the third task of the guided onboarding, you create and run an app on a board.