formengine icon indicating copy to clipboard operation
formengine copied to clipboard

Form Builder (One to one)

Open ababeel-ceo opened this issue 1 year ago • 4 comments

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

ababeel-ceo avatar Feb 26 '24 11:02 ababeel-ceo

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

sergeythrees avatar Feb 27 '24 09:02 sergeythrees

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

ababeel-ceo avatar Feb 28 '24 07:02 ababeel-ceo

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.

sergeythrees avatar Feb 28 '24 15:02 sergeythrees

@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

ababeel-ceo avatar Feb 29 '24 16:02 ababeel-ceo