Designer API
Control the Webflow Designer
element.setAppConnection()
Enables the connection between an element and an App.
App Connections supports the following elements: Image, FormForm, and FormWrapper.
Image
FormForm
FormWrapper
1element.setAppConnection(value: string): Promise<null>
Promise<null>
null
A Promise that resolves to null.
1const el = await webflow.getRootElement(); // Get Root Element23// Check for an element4if (!el || !el.children) throw new Error("Expected an element");56// Append a form element to the root element7const formEl = await el.append(webflow.elementPresets.FormForm);89// Check for App Connection support10if (!formEl || !formEl.appConnections) {11 throw new Error("App Connections not supported");12}1314// Set App Connection15await formEl.setAppConnection("myAwesomeAppManageFormElement");
Try this example