Try to add a date and time stamp when field was updated for specific field, not whole table

I have a form which has lots of fields on it which are tied into different things into the backend database. I have created a timestamp text box and added the expression so that when the user hits Save on the page, that date and time stamp should automatically update to the moment the data is saved in the backend to when the user hits Save. It works, and the date/time stamp is updated immediately, BUT all the other date/time stamps under the text box fields too update to the date and time the user to that moment even if those other fields weren’t updated.

How can I get Bubble to only reflect the updated date and time to the specific field that was updated, and not the entire database?

I realize that the date and time is captured across the whole database and not the specific field. I can’t use autobinding because I keep a track of past entries for the answers to those specific form questions.

It’s not very clear (to me at least) exactly what your asking, or what you’re trying to do…

Maybe some screenshots of your app, workflows, database etc. would help to clarify, and a more detailed explanation of what it is you’re trying to do?..

Okay, I’ll try and to break it down further.

I have a traditional form - RTEs on a page and a save button. Under each RTE there is a field displaying the date and time the last edit was saved. These are in Red here

When the user updates only of the fields and presses save on the page, every instance where there is a date and time display will update to the moment the save button is clicked. What I was hoping to achieve was to only have the field that was updated get revised with the latest, current date and time - not all of them.

Everything on one form on this page represents a row in the database and I know the database captures the date and time per row when ever any field is updated. So what I am trying to do is ask bubble to only show me when this field was updated and by assigning the new date and timestamp to the field the user changed., not updating all of the fields.

In terms of my current expression, its a standard one to show the date and time for the fie:.
Search for Database X:last item’s Modified Date:formatted as 08/Jul/2022, 15:00:15

How and where are you storing the date?

Search for Database X:last item’s Modified Date:formatted as 08/Jul/2022, 15:00:15

Well that explains why the same date is showing on each instance…

Do you have separate fields to store each date? Or is the RTE’s value stored as a separate datatype?

I don’t have separate fields to store each date. Each field on the form is represents its own data type within the database. So when an entry is made or edited, the time stamp is created against they entire thing, and I’m trying to figure a way to display dates and times only when a specific data type is changed.

Ok, I think I understand what you’re doing (and what the issue is)…

It sounds as though you’re modifying all the database entries in the form every time the save button is clicked (instead of only modifying those which have actually been changed).

So to prevent that you can just change your workflow to only update things that have actually been changed…

I don’t know your exact set-up, but I’m guessing you’re running a backend workflow on a list of things to update the database, yes?

If so, then just ensure that list only contains the database entries that have actually changed (i.e. their value IS NOT the RTE’s value)…

That way, only things which have actually been changed will get updated in the database, and the Modified date should reflect that actual date that a change was made.

Thanks, you’ve got it.

This is my backend workflow - and yes, it’s just a list of fields to update based on the values of each of the RTEs.

The question is, how would I implement what you’ve suggested? That is, only make a change in the database to that field that has been updated on the page?

The way I’ve seen that Bubble has something that might be applicable is the ‘When RTE changes’ - click to add an action - am I looking at the right thing to achieve the above?

That might be the simplest way to do it, yes…

Use that to ‘simulate’ autobinding… whenever that value changes run the appropriate workflow to update the thing.

I’ve got that working (I actually already had a workflow that was watching it for any changes in the data to make the Save button appear only when the RTE changed) so have simply added on an activity to the same workflow.

However, as this is working similar to auto-binding, it’s not keeping track of any previous responses - it’s just changing what’s already there to what ever the updated value is. One of my form’s features was to keep a record of all of the previous responses in another database, so a new thing would’ve bene created in one database, and a make changes activity would’ve been triggered for the current data. I don’t suppose that can be achieved via the above method?

Secondly, how would I re-write the expression in the timestamp to reflect the date of the above change?

This topic was automatically closed after 70 days. New replies are no longer allowed.