Hi there !
I'm looking for a way to update an element in the proposal by its urn or id but can't seem to find it.
I see there is a way to update library items, but not the elements created via Forma.integrateElements.createElementHierarchy .
Thank you for your attention!
Solved! Go to Solution.
Solved by mostafa.elayoubi.ds. Go to Solution.
Okay I think i figured out a way.
I use addElement and store the path, then I use replaceElement . Is this the best way to do it?
Thanks!
Hi @mostafa.elayoubi.ds ! Sorry for the late reply, but looks like you found the solution already!
Here is a code example:
const urn = mockRegisterElementInSystem() // See e.g. integrate-elements module
const { path } = await Forma.proposal.addElement({ urn })
const newUrn = mockRegisterElementInSystem() // See e.g. integrate-elements module
await Forma.proposal.replaceElement({ path, newUrn })
The code example is also available in the SDK documentation here.
Best, Vilde in the Forma team
Can't find what you're looking for? Ask the community or share your knowledge.