Update on device storage records not working

Hi, this might have been explained somehow somewhere, but I have not found a solid answer to the problem I have and could not found a solution either. I have been trying to figure out how to create on-device storage data resource and update the same record. The problem is that there is no way to identify the ID of the created record and thus no way of updating the same record created.
By the way, I have watched the tutorial on how to create and update on-device storage resource, but the current composer pro version seems to be different from the version explained in the tutorial.
So, I would like to know the solution and how it works in the current composer pro platform.
Thanks.

Hey,

You can get the id of the created record from the Create Record output. In my screenshot I am using Set page variable with the binding Output value of another node. There you can access all the properties of the newly created record.

@Cecilia , Thanks for the answer.
The problem I am facing is how would you get that ID to update the record when you close the app and reopen? As far as I am ware, the variables will be available within the app when it is running and cleared from the memory when the app is closed.

Yes that’s correct. The common use case for updating record is the following:

You have a list of items in your app, you click on one, and you are able to edit it. In that case the list contains all info about the items, including the id, which can then be used in Update Record. So in some part of our logic flow you’ll have to get the id of the record you want to update, probably by using a data variable list of all your items and searching it from there.

1 Like