DEV Community

loading...

create an object

praveen patel
・1 min read

date1: {enabled: false, label: "Date1 Label", eformVisible: false, mandatory: "NOT_MANDATORY", order: 20}

dropdown1: {enabled: true, label: "Country", eformVisible: false, mandatory: "NOT_MANDATORY", order: 30, …}

text1: {enabled: true, label: "Text1 Custom field", eformVisible: false, mandatory: "ADMIN_API", order: 0, …}
text2: {enabled: false, label: "Text2 Label ", eformVisible: false, mandatory: "NOT_MANDATORY", order: 1}

how to convet data like below formate:

const form_template = [
{
"type":"textBox",
"label":"Name",
},
{
"type":"number",
"label":"Age"
},
{
"type":"select",
"label":"favorite book",
"options":["Jane Eyre","Pride and Prejudice","Wuthering Heights"]
}
]

please help me

Discussion (0)