Creating counter

Hi,

In my app, a user selects a event number and provides description for this event. Event numbers are simple list 1,2,3,4 etc to 30. I made it a dropdown enum field. However, I also need to ensure that the user cannot select the same event number twice AND cannot select a value less than the latest selected event number, i.e. cannot select 2 when the latest was 3 for instance.

Something like VALID IF [THIS VALUE] > MAX Value FROM table_of_values

@AlexShevyakov
I believe it would be easier to list the unused event numbers in your Enum dropdown

{"1" , "2" , "3" , ..... "30"} - SELECT(TableName[EventNumberColumnName],TRUE, TRUE)

Please remember if two users are adding the event number at the same time, they will have the same number and you can’t directly avoid that.

The app will be used by a single user at a time, this is ensured through the workflow.

@LeventK
Hm, not quite sure how to implement this - probably a bit unfamiliar with this logic. Evidently, substituting with actual names I get the following VALID IF expression:

SELECT($SheetData[VoyageN],TRUE, TRUE)
However, the dropdown operates as before, I can select same number n times.
Am I missing something?

@AlexShevyakov
Are you populating the dropdown content from the same table and column that you are querying? How do you construct the list of event numbers from 1-30? Can you please elaborate?

@LeventK
Sorry for delayed response. I have a service table $SheetData which containes pre-populated event numbers from 1 to 30.
User creates an event (a voyage) and is prompted to enter event number. For this, I use enum type and VALID IF expression such as $SheetData[VoyageN] which pulls the data (voyage numbers from 1 to 30) from the table $SheetData.

@AlexShevyakov

SELECT($SheetData[VoyageN],TRUE, TRUE) - SELECT(EventTableName[EventNumberColumnName],TRUE, TRUE)

@LeventK
But this is exactly what I used before - you may see a screenshot above.
I had entered SELECT($SheetData[VoyageN],TRUE, TRUE) it as VALID_IF expression.
Am I missing something?

@AlexShevyakov
I’m not sure if I have understood you correctly. Please confirm the following:
1.) You have a Service Table (named as $SheetData as you speak) which contains a pre-populated event numbers from 1 to 30
2.) You have an Events Table where you create event records and have an [Event Number] column, which is Enum Type where you select an event number
Are these correct?

@LeventK
All data is within a single Spreadsheet.

  1. Sheet $SheetData has column [VoyageN] with the event numbers from 1 to 30;
  2. Sheet Voyages (= event table) has column [#ЛП] which is event number column, populated from $SheetData and used as reference for event description.
    So item 1 and 2 are correct.

Sorry , should probably learn how to describe problems clearly(((

@AlexShevyakov
Теперь я лучше понимаю вашу проблему. Спасибо за объяснение. :slight_smile:

SELECT($SheetData[VoyageN],TRUE, TRUE) - SELECT(Voyages[#ЛП],TRUE, TRUE)
2 Likes

@LeventK

Works perfectly!
Had to change type from ENUM to NUMBER

@LeventK
Much appreciated! Thank you - Спасибо - teşekkür ederim!

1 Like

@AlexShevyakov
Не за что … Мне приятно помочь :slight_smile:

1 Like

@LeventK

Hm, the issue however, is when you try to edit previous record in the Voyages table (= event table), the system says: the entry is invalid. Apparently it thinks that I have just entered this value whereas it is reading from the table Voyages.