optimajet / formengine

Drag & Drop Form Builder Library for React.
https://formengine.io
28 stars 4 forks source link

Form Builder (One to one) #8

Open ababeel-ceo opened 4 months ago

ababeel-ceo commented 4 months ago

Hi Guys

I want to print the output data as like this

{ book_name : "xyz", ... author : { name : "abc", ... } },

Then how can i implement these in formengine

sergeythrees commented 4 months ago

Hi, @ababeel-ceo https://formengine.io/documentation/nested-components#templates Is this what you're looking for?

ababeel-ceo commented 4 months ago

Thanks @sergeythrees

But I tried this { "version": "1", "form": { "key": "Screen", "type": "Screen", "props": {}, "children": [ { "key": "RsMessage 1", "type": "RsMessage", "props": {}, "children": [ { "key": "RsInput 1", "type": "RsInput", "props": {}, "slot": "header" }, { "key": "RsRadioGroup 1", "type": "RsRadioGroup", "props": {} } ] } ] }, "localization": {}, "languages": [ { "code": "en", "dialect": "US", "name": "English", "description": "American English", "bidi": "ltr" } ], "defaultLanguage": "en-US" }

Output is :

{ "RsInput 1": "xyz", "RsRadioGroup 1": "b" }

but need the output as this structure: { RsMessage:{ "RsInput 1": "xyz", "RsRadioGroup 1": "b" } }

If the nested template is the only way then . how can i implement this in my local

sergeythrees commented 4 months ago

Hi, @ababeel-ceo In the near future, we will release a component to group data into a separate object, as you have shown. Please tell us in more detail why you need it, what benefits it will bring, so that we understand how best to implement it.

ababeel-ceo commented 4 months ago

@sergeythrees

I'm try to build a complex form which has (1-1) and (1-many) group

eg: A book has a single author and it has multiple chapter (Just for example)

book:{ bookName : "xyz", price : "123", ... author : { authorName : "abc", ... } chapters : [ { name : "chapter-1" }, { name : "chapter-2" } ] }

So when get the data from user i can able bring the 1 nested object and nested array of object