How do I reset a field in a data record back to empty?

I’m building a library, where users can check out tools. I have the checkout setup almost complete.

The tools collection has fields for borrower name (a relationship), due date, and whether the item is available or not.

Once an item is returned, what would be the easiest way to clear those fields?

When the tool is returned, I intend to scan its QR code and update its record. I assume I just make submit the update with those fields empty, correct?

Is there anything else I should be aware of?

Thanks so much as always!

That’s pretty much what I would do. Update the corresponding properties to Empty when the item is returned.

I would consider having a collection where you store the tool’s history. Each time it was borrowed, by who, times, etc. It may come in handy later on.

1 Like

Do you mean a collection for each tool (I have dozens and will eventually have hundreds) or a single “history” collection recording the overall history of my entire inventory?

You can a hidden input with no value at all, when you want to update a property to empty, just updated with the input value which is empty

1 Like

That’s up to you really. What makes more sense to your app and business.

You can either have a history collection per tool, or one history collection for all tools.

Maybe start with one collection, and as your data grows you will have a better feeling if you need separate collections. But that’s only a suggestion.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.