Sending nested data using Server Connect Form

Hello,
my goal is to send nested data to my API.

I’ve followed this post but despite following the instructions, the nested data itself appears as “” in the preview.

The structure is generated correctly like this:

I’ve defined the Input Data like this: image

And the Linked Fields for the data are named according to the “name” property of the input field according to the proposed schema like this:

So everything appears to be working as it should, up until the last step when I receive the results.

This is what the Payload looks like:

And this is the Preview:
image

Is it no longer working or does it work differently in newer versions of Wappler (I’m using 4.9.1)? What am I missing?

I think that’s the PHP way - I’ve never seen that way in NodeJS

Nested data in Javascript is something like:

lvs.description
lvs.language
lvs.name

So, your request payload should follow that format

Thank you for your suggestion!
Unfortunately, this does not seem to make any difference.

Input Field:
<input id="language" name="lvs.language" type="text" class="form-control" placeholder="Language">

Linked Field:

Result:

Payload:
image

Preview:
image

Put a Set Value post = {{$_POST}} with the Output checkbox ticked to show what Wappler receives - this way you can determine if you have a problem somewhere along your steps

What you define in the 1st screenshot of your last post is just the metadata for the UI - it doesn’t affect the actual script execution

This is the result:
image

That’s interesting, it’s not being nested

Can you try to revert your form to use square brackets instead of dots?

Of course! Same thing happening though, unfortunately.

image

Perhaps you need to JSON.parse() the JSON into an object first?

I haven’t, but I don’t quite see where and when I would do that.

You can parse a stringified respose to an array with the inbuilt formatter parseJSON(). For some reason it is not in the UI so you will have to add it manually.
image

Try using a set value to form an array from the JSON string and then try operations on the array.
No guarantees, not tried it, but I think that may resolve your problem

image

Thank you for elaborating!

I’ve tried your suggestion (with both variants of using brackets and using dots), but unfortunately it doesn’t seem to work. I’m getting an Internal Server Error with the message SyntaxError: Unexpected token u in JSON at position 0, which appears to be common if the data is undefined or not a valid JSON string.