Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form Builder (One to one) #8

Open
ababeel-ceo opened this issue Feb 26, 2024 · 4 comments
Open

Form Builder (One to one) #8

ababeel-ceo opened this issue Feb 26, 2024 · 4 comments

Comments

@ababeel-ceo
Copy link

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
Copy link
Collaborator

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

@ababeel-ceo
Copy link
Author

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
Copy link
Collaborator

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
Copy link
Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants