Possible to update a row?

Hi just wondering of it is possible to update a row to overwrite the value in the field?

I have a number in a master table that I would like to increase by one each time a new user saves their name to a separate table.

This allows an admin to have a master story line lesson open on a whiteboard where they can see a live count of the amount of students who have started a lesson on their mobile phone in the classroom.

I have it working but it will add a new row with the number value 1 instead of incrementing the existing row.

Any help greatly appreciated!

October 10, 2019, 7:57 am

Click for thumbs down.0Click for thumbs up.0#1

You can use the function CloudMeta('rows','somevar'); to get the number of rows the table currently contains. Just replace somevar with the name of a variable you will use. Upon function execution, the variable will contain the number of records currently in the table.

Note that this function is in beta testing. You shouldn't run into any issues, but if you do, please post them here so that they can be addressed.

October 10, 2019, 1:31 pm

Click for thumbs down.0Click for thumbs up.1#2

Thanks @cluelabssupport for the quick reply.

That worked perfectly, thanks. Is there anywhere online where developers can see a list of functions available to use?

Many thanks for your help, awesome tool you guys have created!

October 11, 2019, 2:45 am

Click for thumbs down.0Click for thumbs up.0#3

Stephen, once the CloudMeta function is approved, it will be listed on the "How to use..." page. Currently, "rows" is the only option available to the public. If you have a suggestion for another useful option, feel free to post here. Now is a good time to provide suggestions while the feature is being worked on. Thank you!

October 11, 2019, 9:09 am

Click for thumbs down.0Click for thumbs up.1#4

To overwrite a value based on the row ID would be extremely useful!

I am actually stuck on this now and can't use the widget as hoped, Is there any way to do this currently?

Thanks guys!

October 15, 2019, 6:03 am

Click for thumbs down.0Click for thumbs up.0#5

While we recognize that it would be useful to update the rows based on record ID, that would also mean that each user can potentially have access to other people's records, which we don't think is appropriate. The users are recognized by a unique token (stored in a variable stencilusertoken). If you resume the module and the value is not blank, then the user can overwrite/update their saved records. Otherwise, if there's no token, a new record is created. Potentially, there are multiple ways to save and reuse the token (e.g. through cookies, URL parameter, hard-coded value, etc.).

Additionally, If you have ideas on how to implement data overwriting and/or returning user authentication without compromising other users' data, feel free to suggest.

October 15, 2019, 8:57 am

Click for thumbs down.0Click for thumbs up.1#6