I have a field on my user table that I allow the users to update with a Note item (because it’s actually a really good little editor). I’d really like an extra field showing when this one was last updated. However, I can’t attached that as a action on the save/update buttong because you don’t need to use one on Note components.
Any thoughts on either how to do this, or whether there is a better way to have an editor for long text blocks?
Edit: Seems to be the same issue if I use text entry and stick to plain text. Value is updated when I exit the field so I can’t see how to attach the updated timestamp
You could use an edit screen with the note component. Open the edit screen, let the user make changes to the note, and then let them submit the form. You can add a Date/Time Special Value component to your form which will automatically update the date every time they submit.
At the moment these two fields (data + updated) are stored on the users table. Have I understood edit screenss correctly that I would probably have to move this into its own table as I also have an edit screen for users table that focuses on the main screen?
You don’t have to move it into its own table, you can just use the edit screen for the Users table. I guess the question is if you only want to log the timestamp when the note is edited, or the last edit to that row is saved. If your answer is the second one then Jeff’s method will work. If it’s the first one then we might be able to have a workaround.
Thanks for the replies above. I’m definitely still not getting something here. However, I’ve decided I am way too focused on that small detail of a last-updated field and it isn’t that critical at the moment. Time to move on to other things for now, but thanks.
Yes, you are correct, there can only be one native Edit screen linked to each table.
Just a few rough ideas:
One is to use the same Edit screen, but have two separate buttons for editing either the profile or notes. Each would have a custom action that first sets a value in the user row, and then opens the edit screen. That value would be used for visibility conditions to display either the notes component or the other profile components. You would also probably need an OnSubmit custom action to determine if the date should be set or not based on that value.
Another way is to have a separate table just for notes like you mentioned, but that can probably open a can of worms as far as when to create a row if one doesn’t exist yet. It’s doable, but requires some custom action logic to handle that
Another option is to keep everything in the user table and have a New Screen that acts as a custom edit screen which is just a new screen linked to the same row. You would need to preload a user specific columns with the existing notes before opening the screen, then have a submit button that writes the user specific value to the notes column, as well as sets the date.
There are several options, but which one you choose depends on the user experience you want.