Hey @BAS! Happy to try to help clarify things for you.
In Retool, the "Query by Key" action requires the "Key path" as input. The Key path is constructed by specifying the path of the kind and the name or ID of the entity. If the entity has a parent(s), you need to include the parent(s) kind(s) and name or ID(s) as well. Here's the general format:
[Kind1, ID_or_Name1, Kind2, ID_or_Name2, ...]
For example, if you have a customers
kind and you want to query an entity with the ID 12345
the key path would be:
["customers", 12345]
If your entity has a parent, let's say within the kind region
and the name Europe
, the key path would look like this:
["region", "Europe", "customers", 12345]
To use the key path in your Retool app, you'd input it in the "Key" field of the "Query by Key" action in your Google Cloud Datastore resource query. Remember that the key path should be in an array format.
Alternatively, you can query an entity by providing a JSON representation of the key. In the "Key" field, enter the JSON representation of the key like this: { "path": [ { "kind": "YourKind", "name": "your_name_property" } ] }
Replace "YourKind" with the Kind of your entity and "your_name_property" with the actual name property value of your entity. After setting the "Key" field properly, you should be able to fetch the entity and also save it back to the datastore using the update and create actions.
If you're still having issues, feel free to share more about your specific datastore structure, and we'll be happy to help further!
Please let us know if you need any further assistance or have any additional questions or concerns!