Datastore not showing array fields when trying to add or update

Wappler: 4.6.0
OS: MacOS
Server Model: PHP

I’ve added a Datastore to the page but I’m not getting any of the variables when trying to use the add or update element.

Here’s my datastore:

And this is what I get when trying to insert a record:

I’ve used the Datastore many times in the past so I know it used to work but doesn’t seem to now.

Help!

Can anyone confirm this is a bug for everyone or just me?

Everything looks correct here:

Maybe there’s something specific on your page that’s causing this? Have you tested on a blank/new page?

Thanks @Teodor. I will try a blank page now. I wanted to establish whether it was a wider issue before doing more testing.

Just tried on a completely new page and have the same issue.

What data store structure exactly are you testing with?

Screenshot of structure is in my first post

Looks like it’s the arrays?

But why have you defined an array items? The data store is an array already - you define your columns directly below it.
Such nested arrays are not available in the UI.

I’ve changed it to this:

Screenshot 2022-02-18 at 10.27.50

The first three fields now show but not the array.

I need to match the array structure for a PayPal Checkout.

Unfortunately arrays and objects are not supported in the insert/update datastore actions UI.

Aah. Is it easy to hand-code them? Can you give me a quick example? I assume I can keep that structure and just hand code the insert/update?

There was a discussion a while ago, how to do nested array. There isn’t really an optimal practical way yet. So it depends on your needs.

That’s an excellent thread and explains exactly the issue I have. For some reason I completely missed that last year when it was posted.

My need for arrays is to create the same structure as required by PayPal Checkout. Please see this thread for the background:

If you’re able to just give me some example code then I’ll happily hand-write it. I just need a steer in the right direction.

Well you can use any valid javascript object structure, if you code it manually:

dmx-on:click="datastore1.insert({name: 'name_1', description: 'desc 1', unit_amount: [{currency_code: 'xxx', value: 22}, {currency_code: 'yyy', value: 33}]})"
1 Like

Thanks @George. I shall give it a go.