Enum remember last selected value

Hi Guys.

Im trying to make Enum remember last selected value, i got like 10 values in the enum, and user can’t add his owns. Im trying to make last selected value a initial value, to make a process of adding things faster, but can’t sort it our.
been working with MAXROW() but i think i do somethings wrong, most of time it game me an error like :
“The expression is valid but its result type ‘Ref’ is not one of the expected types: Enum”.
So i tried with any select
ANY(
SELECT(
TABELA AUTOMATYZACJI[Lokalizacja],
[_ROWNUMBER] = MAXROW(“TABELA AUTOMATYZACJI”, “_ROWNUMBER”, TRUE)
)
)
But nothing happens, it just doesnt trigger, nothing shows up, just like the initial value doesnt exist.
tried some other things, but most of time it was an error, or nothing happened like with 2 previes ones.

So i came here with a question, is there any easy solusion for this, that i couldn’t find?

Try

ANY(
SELECT(
TABELA AUTOMATYZACJI[Lokalizacja],
[KEY COLUMN] = MAXROW(“TABELA AUTOMATYZACJI”, “_ROWNUMBER”, TRUE)
)
)

MAXROW returns a key value and I am guessing you do not have _RowNumber as the key.

1 Like

Thank you so much! it worked exactly how i wanted :grinning_face_with_smiling_eyes:

This solution has already been useful to me, however, my question is a little different: I need to return the value following the one found in this formula, that is, in a training app I need to bring as the initial value the training following the one performed by that particular user, for example, there is a list of trainings, WORKOUT A, WORKOUT B, WORKOUT C, and the previous training was WORKOUT C, in this case, I need the initial value brought in the next training entry to be WORKOUT A. In the solution presented, I can already return the same training that was performed before, in the case above, WORKOUT C. How can I complement the formula so that WORKOUT A is returned?

Please start a new topic for help with this.

1 Like

Initial value for Enum field returning the next value from the list

Thanks

1 Like