How to unflatten flat json to rebuild rest api payloads
- Step 1Collect the flat key-value payload — Copy the flat JSON from your form serializer output, CSV-to-JSON result, or URL query string parser. Keys like address_city or address.city will be reconstructed into nested objects.
- Step 2Choose the separator used in the flat keys — Select dot, underscore, or bracket notation as the separator. The unflattener splits each key at the separator and builds the nesting hierarchy from the resulting path segments.
- Step 3Review the rebuilt nested structure — Confirm the output JSON matches the API's expected request body shape. Check nested objects that contain numbers or booleans to verify they were not converted to strings during the form encoding.
- Step 4POST the nested JSON to the API — Copy the output JSON and use it as the body of your API request: fetch('/api/endpoint', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(output) }).
Frequently asked questions
How does the unflattener handle numeric string values from form fields?+
Form submissions send all values as strings, so age: '25' remains a string after unflattening. If the API expects numeric types, run the unflattened JSON through the JSON Format Fixer or type-cast the fields explicitly in your request builder.
What about arrays in flat form data — like tags[0] and tags[1]?+
Bracket notation with numeric indices (tags[0], tags[1]) is reconstructed as a JSON array in the output. The resulting tags: ['value1', 'value2'] matches the expected nested array structure in the API request body.
Is the form data or API payload transmitted to JAD Apps?+
No. The JSON unflattening runs entirely in your browser. Form submissions, personal data, and API request payloads are never transmitted to JAD Apps servers.
Privacy first
Conversion runs locally in your browser. No file is uploaded — only metadata counters are saved for signed-in dashboard stats.