Data Store component - problem selecting records

======== TEMPLATE BUG FORM ========

Wappler Version : 2.6.1
Operating System : Windows 10

Expected behavior

Having defined the Data Store schema, the corresponding options should be available when adding actions to add, update or delete records.

...YOUR TEXT HERE ...

Actual behavior

The only options under 'WHICH RECORDS' is 'ID'.

How to reproduce

Add a Data Store component and define the schema. Add a table, using the Data Store as the source. Attach events to buttons to manage the data. The items defined in the schema are not available to select.

I haven't used the Data Store component since first trying it out when is was released, so I could be doing something silly - but I don't thinks it's working as it should/was.

It would be nice to have access to the Data Store variables (all page variables for that matter) available from within Server Connect ideally. At the moment we echo them to hidden inputs and use a multi insert step to store to the database… Like Tom maybe I am missing something here?

Could this be something Flows could be useful for? @Teodor @George

Yes as the flow runs client side you can use all the data on your page as you wish.

Within a server action as I runs server side you only have access to the variables you pass to it.

1 Like

Of course. I did think that as I looked back on my post, apologies for my ignorance George.

New signature? :smiley:

Ah iPhone typos :slight_smile:

1 Like

Just to clarify the issue.

I attached this event when originally trying out the Data Store component. Howeve, after updating to 2.6.1, there is no option to select the values:

Similarly, there’s nothing to select when updating, except for the ID:

image

Unless I did something in a completely different way before, this seems to be a bug. Can anyone else get the Data Store component to work?

When you call the edit schema on the data store, does it shows the right fields of the data store?

Yes.

image

… but I only see, eg:

image

uh - why do you have an array called pets in your data store? The data store by itself is a table/array.

When you define an array like this means that for each record you want another array …

Just put your fields directly under the data store name, like this:

image

I had been using a sub-folder as well. I thought you should probably do it that way to keep things organised, especially if you have many fields being stored from different parts of the site.

So this should only be stored at one level?

Thanks George. That’s solved it.

I’m slightly confused because I had created a test file which was working fine - it was based on Teodor’s tutorial. When I opened it after the update, it was still working, but I couldn’t add or modify the events used to populate the table based on the Data Store component. Anyway, there doesn’t seem to be a problem after all…

Well you need at least one level. Nested objects and arrays are possible - but we haven't add this to the UI yet. Still haven't found the best way.