How to use triggers to create UUID for new records

I am looking to auto-create a unique UUID for each new record. I have tried triggers but I'm sure I am missing something simple. I set the trigger up on the "Company" table for example to be triggered on new record Insert. In the function stack, I added a query all records and tried a filter on company_UUID == null. I also tried "...== (blank)" - I keep getting errors, and perhaps this is not the best way to do it anyway. I then had a Patch function on the Company table mapping the prior result ID to the PATCH and using the filter "uuid" to create it. I could not get past the first step. Maybe I don't need to query all? Thanks for any help here.

4 replies