2

I am using Form.io's Formbuilder, I have built a form using the Formbuilder's drag and drop functionality and I have saved the generated JSON Schema into my database. How can I reconstruct the form builder again with the same controls from JSON Schema?

I want to do this so that the user can make any modifications to the created form.

I am looking for how to reinitialize the form builder back from JSON.

JSON was generated from the form builder's builder.instance.schema.

1 Answer 1

3

I was able to to load the form back by passing the json schema to Formio.builder. I was using vanilla javascript. All credits to @randallknutson's Github reply.

//JSON Schema loaded from database
const createdForm = {
display: 'form',
components: [],
...
}

Formio.FormBuilder(document.getElementById('builder'), createdForm, options);
Sign up to request clarification or add additional context in comments.

1 Comment

can you do this with just inferring the data? not everyone is gonna send you a schema unfortuantely

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.