Iโm sure this topic has been covered dozens of times but I must be slowโฆ
My app is trying to log instances of contacts with customers. The form references the list of clients to select from. If it is a new client the user selects โNewโ and is taken to the Client Form. Once the user inputs the Client info and saves they are taken back to the Contact Form but the Client ID is populated in the Client Name Field. What am I doing wrong.
Note: The Contact Table has references in both columns for Client ID and Client Name.
Thoughts?
Why double ref columns? Do they ref to the same table?
No need I guess. Should I just reference the Client ID? I would like to allow the user to select from a list of Client Names in the form.
Ignore me! Iโm an idiot! And to prevent anyone else from making the same mistake, Iโll post my embarrassing solution hereโฆ
In my client list I have 3 columns in the tableโฆ Name, First, Last. In the Form Iโm asking the user to input First and Last. So when they submit the form the First and Last come over but the Name column is empty. So when the user is taken back to the Contact Form there is no value in the Client Name column to insert, so it defaults to the Client ID.
My fixโฆ put a formula in my Name column on my Client Table: [First]&" "&[Last].
It must be Friday!..looky thereโฆit is Friday!
Hang onโฆthis still isnโt working as expected. The Client Name comes over into the Client Name field in the Contact Form but once submitted, Iโm getting the Client ID in the Client Name field in my data.
What am I missing?
When you use a REF column, the dropdown list always displays the LABEL column value of the referenced table. However, when the record is saved, it records the KEY COLUMN VALUE of the referenced row. In general, provided you have a First Name and Last Name columns, AppSheet automatically created a Virtual Column of [_ComputedName] and assigns it as a Label column. So with a REF to this table, the dropdown displays the values from this Virtual Column.
I may advise removing that Name column from the Client table initially. Following regenerating the column structure, provided AppSheet does not create this afore-mentioned virtual column, create it manually, give any column header as you like with a simple expression of [First]&" "&[Last]
and assign it as the Label column for the Client table.
Levent,
Thank you! After agonizing and stepping through this process one mini-step at a time, I learned a big lesson about REF. I finally realized that you can โfoolโ the user into thinking they are choosing from a list of names vs a list of IDs by changing the Label. Also, by changing the Display Name to โClient Nameโ the user doesnโt realize they are actually selecting the ID.
I finally understand the concept!!! YesโฆIโm slow! Now if I can just retain this lesson.
Thanks for sticking in there with me!
Youโre very welcome.
Una consulta Mike en este caso como hiciste para que se guarde el label y no el id de la tabla, tengo ese problema, entiendo que al tener una referencia nos guarda el id de esa referencia pero existe alguna forma de dejar una expresiรณn que cuando vaya a guardar esa referencia guarde otro campo y no el id?
User | Count |
---|---|
39 | |
35 | |
29 | |
23 | |
18 |