Avoid duplicate month entries for monthly reporting

I’m having companies report their revenues via a form in an app. If I use a date-picker I get nice data (and can pull the month / year), but I don’t know how to prevent them adding data twice in the same month.

If I prefil the months/rows (i.e. with their projected revenue) and then use choices with the months with blank revenue I can ensure no duplicates, but I lose the data format.

If I prefil and show a table then they can just edit blank cells, but they might edit the wrong cells or change past cells.

I don’t want to use an update each entry they make (so no text to date, not that I understand it well anyway).

Is there another option?

Solved this with a fun approach: I’ll first make projections (means I can use the date picker as I’m relying on staff not external users); this creates a collection and I show the months with a slide in edit form; once they report, the collection filters that month away.

You can consider this approach:

  • Have a button to open that form, which I assume you have already.
  • Record the company’s email/ID in the submissions table, and the timestamp that they report their revenues. I assume they always report at the end of the month, the approach would change a bit if they always log July’s revenues in August, for example.
  • Have a Math column in the destination table: YEAR(D)*10^2+MONTH(D) with D being the submission date.
  • Have a Math column in your users table: YEAR(N)*10^2+MONTH(N) with N being the “Now” value.
  • Have a query column in your users table, target the submissions table, filter by email/ID is this row’s email/ID, and the submission date’s Math value being equal to this row’s “now” Math value.
  • If the query is not empty, hide the form, and vice versa.
2 Likes

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