Hello, the goal of my app is to allow a system for a certain group of people to submit an attendance form weekly. is there a way to make it so that it resets weekly for each user? When users fill out the form it logs whether or not they are coming, a reason why they are not coming if that is applicable, and the date that they submitted the form. I have figured out how to reset it for users individually, but how can I reset this data automatically every week or all at once?
What type of form are you using, and how did you set it up? (screen shots would be useful).
If you use a native Glide form there is no need to reset anything, by default you get a fresh empty form every time it’s opened.
here are some screenshots. we have the data going into the users data table, as the form stays the same week after week. we want our users to fill out the form weekly, and we want the attending column to reset to “no response” and for the date to clear. we will have upwards of 50 users, so we want a way to reset these data points week after week as a whole, not individually.
Okay, if all you want to do is set a couple of columns in your users table, do it like this:
- Firstly, make sure you have User Profiles properly configured.
- Next, make the source of your screen your Users table, and filter it “where email is signed in user”. This will ensure that each user is updating the correct row.
- For your “Submit Calldown” button, use a Show Edit Screen. Add the appropriate entry components to that.
- For your “Reset Calldown” button, give that a Set Column Values action, and use “Clear Value” on the columns you want to clear.
that makes sense, although we want a button to allow an administrator to be able to reset the data for every user, possible automatically at a certain time every week.
Do you mean with a single click?
That’s possible, but right now the only way to do it is by using the Glide API. In the not too distant future, there will be an easier way to do it.
However, there are other techniques that could be employed. For example, you could have a value that your Admin sets that effectively invalidates the data for every user. Maybe something like the following:
- Create another table, and add a single row to it and add a text column.
- Create a button somewhere that your Admin can use that sets a Unique Value in that column
- In your Users table, create a Single Value column that references the unique value column in the other table. This will give you the same value in every row.
- Add another Text column to your Users table.
- When a User submits the Edit form, use an onSubmit action to take the value from the Single Value column and write it into the Text column
- Now for each of the columns you want to reset, create an if-then-else column:
– If Text column is Single Value column, then “column you want to reset” - Now where ever you display those values, use the if-then-else columns instead
- One last thing you will want to do is make the action on your “Submit Calldown” button a custom action with two steps:
– Set column values, to clear the values that have been reset
– Show edit screen
The effect of all the above is that every time your Admin clicks his reset button to change the unique value, the data for every user will “disappear”, and they will need to add it again.