spotty-amberS
Refine4y ago
18 replies
spotty-amber

How to create a nested form?

I want to create a nested form and send data on API post request. How can I achieve that?

For example I want to send a data in POST request as:

{
    "name": "person name",
    "user": {
        "phone_no": "1234567890",
        "email": "example@mail.com",
    },
    "office": [{
        "name": "office1",
        "registration_number": "123456",
        "address": [
            {
                "state": 3,
                "district": 28,
                "city": "Panauti",
                "tole": "Malpi"
            }
        ],
        "contact": [
            {
                "phone_no":"12343213",
                "is_primary": false
            }
        ]
    }]
}
Was this page helpful?