Good Morning!
I am creating an app relating to logistics. The function that I am trying to build is when a button is pressed, it sets the vehicle to the ‘Next Status’ (such as ‘en-route’ or ‘arrived’) and logs the current time. This then steps through all status. I currently have the ‘Statuses’ sorted by creating an Option Set with a ‘Next Status’ attribute so the next Status is always known. However I am unable to work out how to insert the current time into the specific database field (see below) that is related to the status.
Good Morning! Apologies - Ill try and rephrase using a different example that may answer the question in my head.
I would like to insert data into a specific field on a thing, however the function needs to be dynamic as the previous step would inform which field needs filling. I am trying to work out how this would work?
Thank you folks, I will go and have a look at these now. Was trying to avoid conditional workflows if possible to minimise data processing. @georgecollier I was aiming to minimise front-end processing as I only need times as 00:00 and thought re-formatting times front-end from dates to time may hinder processing… am I looking at this incorrectly do you think?
The second you convert a date to text, you can’t do anything with it. In Bubble, you have no way (well technically you can really inefficiently) of working out when that date is so it is virtually useless. If you wanted to display the shipment progress on a timeline for example, you basically can’t do this if you have the times saved as text. In addition, you can’t account for timezones if saved as text.
Save each status update time as Current date:time. Don’t round it at all. Then, if you want to display it on a page, use :formatted as date and format as dd/mm/yyyy or something which will only show the date rather than the time. Equally, if you want to display the time just use hh:mm.
Thank you @adamhholmes. I am not aware how to define the field to modify dynamically… and cannot find any literature on it. Have you got any time to expand at all?
If drop-down value is P, action to modify field Q. If drop-down value is Y, action to modify field X. In this case, you have two Make changes to a Thing actions which both have Only when Dropdown’s value is P in the first case or Y in the second case.
If I was building this app I’d have a data type ‘Status Update’ which contains the Shipment, date, and Status. Then, on the shipment I’d have a list of Status Updates which contain info about what status was updated to and when.
In many cases, if you need to dynamically specify fields, you actually just need a new data type and will find that easier to work with and build on in future.
Thank you @georgecollier and @adamhholmes for your support, I raise my coffee cup to you! Got exactly what I need and in a new approach that you have taught me.