Form-js examples

form-js looks really cool, but the examples repository doesn’t seem to work, and lacks a readme.

Is there a way to build a form on Form Builder | demo.bpmn.io and then render it and get the data from the rendered form?

Hi @tacman, welcome to the forum!

The examples are indeed rather simple at this point. Do you miss something? In that case, feel free to open an issue in the repository.

Is there a way to build a form on Form Builder | demo.bpmn.io and then render it and get the data from the rendered form?

This sounds that you’d need a) an editor (e.g. the demo) to create your form and separately b) a viewer to use the form in your application.The form viewer offers an API to get the submitted data from the form.

const form = new Form({
  container: document.querySelector('#form')
});

await form.importSchema(schema, data);

const {
  data,
  errors
} = form.submit();

I recommend looking at the Playground. This way, you get a broader viewer how the different form-js components work together (viewer, editor, input and output data).

1 Like