Dropdown showing only ID, I need the label

Hi,

I'm having problems with a dropdown list.
In a form, I need the dropdown on [Faz parte do grupo:] to show Labels based on a selection of the previous field [Tipo de Plano] but it is only showing the IDs and not the Label. (See imgs below)

checktheclaws_1-1674056744608.png            checktheclaws_2-1674056762700.png

- The label is correctly chosen:

checktheclaws_0-1674056638170.png

If I put it to Ref, it "kinda" works. The values I'm trying to get are from and to the same table, that's why, I presume, it gets the IDs instead of the Label.
But the problem here is that when it gets ref, the form displays the option to select or add another record. I mean, it opens the same form and this could be abused by the user or create problems in a loop of instances of the same form opening, I believe.


Am I doing something wrong?
Can anyone help me with this?

OBJECTIVE EXPLANATION ======================

I'm doing an Accounting Plans grouping and this idea is for the user to chosen under wich group his addition will go, that's why the dropdown gets the list from the same table, because it has levels, 5 to be precise.
So the user choses a record that is already created and the app will get the numbering of that record and the last number the user will chose, but it will get under the record he chose.

Per example
We have:
1. Payments

1.1 Taxes

1.2 Water bill

2. Receivings (don't know if that is the correct word for this)

2.1 Products Sales
2.1.1 Computer parts

The user needs a new record called Printer Parts wich should be 2.1.2

So he needs to put it under 2.1 - Products Sales

>> He choses in the form field [Tipo de Plano] (Plan Type) the root primary group wich is 2, in this case

>> The app displays in the next field [Faz parte do grupo:] (Is part of group:), the list wich come from the root group 2 (Receivings) only.
>> He choses under wich one it will be. In this case, 2.1 Products Sales

>> Then he choses the last number for his own disposition of records, he can chose the number 2 wich will be the sequential for this group, but he can freely chose this as number 10, 50, 80 or 1000.
It would be like 2.1.80 - Printer Parts.

The suggested values expression (so far) I'm using at the moment is: (trying just for the first group till it works out)

 

SWITCH(
       [Tipo de Plano],
       "1 - Pagamentos/Despesas",
       ORDERBY(
               FILTER(
                      "PLANO DE CONTAS",
                      [Nível 1]=1
               ),
               [Numeração do Plano]
       ),
       LIST("Selecione o tipo de plano de contas primeiramente.")
)

 

If you need more data just ask.

Sorry if I misspelled something!

Thanks!

From Brazil.

0 2 222
2 REPLIES 2

Questions like this should be posted in the Q&A board, where they're more likely to be seen by someone who can provide an answer and won't confuse anyone reviewing this Tips board for the type of content it's intended for. I suggested to moderators that they move the post.


@checktheclaws wrote:

the form displays the option to select or add another record


Consider trying:

@dbaum thank you for the reply.

I'm sorry if I posted it  in the wrong place.

Anyway, I found a solution.

I put the code in the valid if field, but that doesn't solve the problem. It keeps turning on the Allow Other Values checkbox. I think Appsheet did not recognize the List in my code, or doesn't recognize it as a list of available values to choose from.
The code was the same as in my previous message.

So I had to write the same code in the Suggested Values field. Both equal. This way it stops turning on the allow other values checkbox.

Still I had the problem with the label not displaying in the list dropdown to choose an existing record.

So I configured the column like this:

Type: Enum

Basetype: Ref

And the Referenced Table as the same where the column is: PLANO DE CONTAS

(I was doing the inverse, Ref in the first field and Enum or text in the second.)

This way it doesn't show the option to add another record inside the same form, as it was creating an infinite loop inside the form.

Here is a screenshot of what I'm talking about for the ones that need something more visual:

checktheclaws_0-1674158717550.png

This did the trick. But thanks for your ideas anyway. Really appreciated.

Top Labels in this Space