Updating an Entity on Google Cloud DataStore

Hello,
I am trying to update an existing entity on Google Cloud DataStore as a trigger resulting from an edit action on a table row.

To accomplish this, I linked a "save" trigger to a query set up as follows:

  • Action type: save entity
  • Kind: entity kind name (e.g.: "Users")
  • Key: {{table1.selectedRow.data._key.id}}
  • Data: {{table1.selectedRow.data}}

It seems to me that there are two issues:

  • the key is saved using the NAME (string) identifier, and there is no way to force it into using the ID (numerical) identifier;
  • the entity contains a _key field, which should not be there.

What am I missing?

Furthermore... what is the correct way to update an existing entity whose key contains an ancestor? What is the correct way to save a new entity with an auto generated id with an ancestor?

Thanks!

Hey @Giorgio! I believe most of this is covered in this post. But definitely let me know if you have any follow up questions!

The post is about querying the DataStore, my questions are about persisting informations.
Hence... no, my question has not been answered!

How can you store an object using an ID (numerical) identifier? What if the key has ancestors? How can you store an entity as it is, without having to manually recreate it by hand every single time?