Remove entered values of refrows

Hi guys!

I have had problems with the following situation:
I have a form with a RefRows, pressing the new button takes me to a form where I have a dropdown that is also referenced and shows me a list of values from a slice.
I need several records to be entered into the list but to be removed from the drop-down list of the second form to prevent the user from entering repeated values.

Hi @javimur36

If my understanding is correct, you wish to avoid a double-selection of the same item in the related children.

You can perform such system with 2 virtual columns and a valid_if expression.

Let’s assume you have:

  • table REGMESA, with columns [id regmesa] and [Related VOTOs] (type List, base type Ref) (named in your example “Votos candidatos”)

  • table VOTO, with column [id voto], [REGMESA] (type Ref) and [CANDIDATO] (type Ref)

  • table CANDIDATO with column [id candidato]

  1. create a virtual column [_RelatedCANDIDATOS] in your table REGMESA with this expression:
[Related VOTOs][CANDIDATO ]
  1. create a virtual column [_RelatedOtherCANDIDATOS] in your table VOTO with this expression:
[REGMESA].[_RelatedCANDIDATOS]-LIST([CANDIDATO])
  1. use the valid_if property on your column [CANDIDATO] in your table VOTO with this expression:
FILTER("CANDIDATO",
  NOT(
    IN([id candidato],[_THISROW].[_RelatedOtherCANDIDATO])
  )
)

For reference:

FILTER() - AppSheet Help

Drop-down from Valid_If - AppSheet Help

Here is the result:

Screen Recording 2023-09-12 at 07.25.33.08 AM.gif

Thank you very much for your response, just what I was looking for.