I have an app built on Airtable that allows users to make time sheet and spiff (commissionable actions completed) entries. All records for both sets of data reside in one table called Payroll. Individual form screens are used to make Time and Spiff entries respectively. The Payroll table includes an Entry Type field with possible values being “Time” or “Spiff”.
Time entries are made by either pressing a New Timesheet Entry form button, or the + icon in a Timesheet details screen. I created a custom action for the On Submit icon in the upper right corner of a Create New Timesheet form to Set Column Value in the Entry Type field (for this record) to “Time”, Send a Notification (Timesheet Submitted) and Go Back to the prior screen.
The same strategy is to be used from the New Spiff Entry form, where Entry Type Column Value will be “Spiff”.
When submitting Time entries, I can see the record being created in Airtable, but there seems to be a significant delay in updating the Entry Type column value to “Time”. At one point, I thought the custom action was not working. I left my desk and, upon return, the field had updated for the last two records I had created.
I also noticed that, upon creating another new Time entry, that if I manually updated the data base synchronization from Glide, the field updates. Is there a way to make this work quicker? My custom action only has 3 steps.
Thanks in advance for any suggestions.
I try to avoid setting column values using On Submit. Instead I would probably add a template column in your user profile table with the word ‘Time’. Then add it to you form as a user profile value component.
That way the value is added when the row is created, instead of adding it after the row is created.
An alternative is adding a text entry, set the default text to what you want, then hide that component with a condition that will never be true.
It is possible to have the Entry Type be either Time or Spiffs. So, it’s not a matter of who the user is, rather (based on how I have it designed today), which input form is used to create a record.
For example, if data is submitted using the Create Timesheet Entry form, then the Entry Type value is “Time.” If the data is submitted using the Create Spiff Entry form, the Entry Type value is “Spiff.”
TinhDinh can you elaborate on your idea please?
You have two separate forms, correct? With my idea, you would create two template columns in the user table. One populated with ‘Time’, and one populated with ‘Spiff’. Depending on which form you are in, you would add the appropriate user profile value component. If you are in the Time form, then pass the Time value into Entry Type. If you are in the Spiff form, then pass the Spiff value into Entry Type.
If you wanted to go with @ThinhDinh’s idea, then what you do is add an entry component that points to your Entry Type column. Set the default value to either ‘Time’ or ‘Spiff’ depending on which form you are in. Then set the visibility on that component to hide it with a condition that will never happen. It will never be visible, but will still write that default value to the table. Thinh’s solution avoids the need for creating template values in a user profile table.
Thanks Jeff. Will give that a look.