Hide ID field in the detail view

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
sblasic
Veteran Member
Posts: 53
Joined: 2021-02-22 15:55

Hide ID field in the detail view

Post by sblasic » 2021-07-02 07:57

Hi girls & guys,

I have a basic "contacts" table (imported CSV).

I would like that the ID field (integer) to be hidden from the user in the DETAIL VIEW and that this ID field will be filled automatically when adding a new contact (not needed the user's input).
id_field.png
id_field.png (13.33 KiB) Viewed 2082 times
The way it is set now - ID field must be filled by the user when adding a new contact and I would like to avoid that...

Thank you in advance for any help!

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Hide ID field in the detail view

Post by jsetzer » 2021-07-02 14:16

Whenever you create a new table in appGini and then create a first field named "id" AppGini will automatically turn that field into a primary key field with unique index and auto increment number.

If you just leave it as is and regenerate your application the value of id will be generated automatically on insert.

You don't have to change anything else.

If you don't want users to see the field, just check [x] hide field in detail view.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

sblasic
Veteran Member
Posts: 53
Joined: 2021-02-22 15:55

Re: Hide ID field in the detail view

Post by sblasic » 2021-07-03 08:49

@Jsetzer

Thank you very much for your feedback!

I have find-out just now that I have to check the box "Auto increment" within the ID options to achieve what I want - it is not set "ON" by default...
auto_increment.jpg
auto_increment.jpg (23.29 KiB) Viewed 2040 times

BUT - when I do that - the ID counting starts from zero (0) and not from the last ID number loaded from the CSV file (in my case is 1024...)

I guess I have a new question - if I generate a table (containing the ID field) imported from the CSV file - is there a way to set the "auto increment" option of the ID field from the last ordinal number loaded from the CSV file (in my case, the next ID number should be 1025)?

Best!

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Hide ID field in the detail view

Post by pbottcher » 2021-07-03 12:05

Hi,

which version are you using? If you add to a new table at the beginning the id field, AppGini will set Primaray Key, Auto Increment, Unsigned and Hide in table view automatically. No need to do anything (as Jan wrote above).

If you import your data in the squence you do not need to specify the id, so the database will assign the incremental value to the id. In your case if you import 124 record, the next will get id125.

if you already have records in your table and import new data with higher id's, the database will automatically adjust the id field to the highest id +1.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

User avatar
baudwalker
Veteran Member
Posts: 188
Joined: 2015-02-03 08:08
Location: Bellingen NSW Australia

Re: Hide ID field in the detail view

Post by baudwalker » 2021-07-04 23:58

From within Appgini select the ID field and check "Hide in detail view"
Attachments
ID feild.JPG
ID feild.JPG (49.28 KiB) Viewed 1993 times

sblasic
Veteran Member
Posts: 53
Joined: 2021-02-22 15:55

Re: Hide ID field in the detail view

Post by sblasic » 2021-07-05 09:38

Thank you very much for your feedback!

@ pböttcher

I'm using the latest PRO ver. 5.97, revision 1142

The process of importing the CSV file in my AppGini aplication was like this:

1 - I have the XLS file containing CONTACTS (Name, address, phone etc.) - the very firs column in that EXCEL table is called id and it has an integer value (1,2,3....);

2- I export this XLS to CSV (using a comma (,) as field separator;

3 - In the AppGini, I go to IMPORT > TABLE FROM CSV file;

3 - Upon importing - the AppGini does not automatically recognized the id record as the primary field, I have to do that manually;

(But it recognizes the data of all the fields correctly!)

Is there an option in AppGini where I can set the program to look for an id field when importing CSV?

@ baudwalker

I did that - and it has no desired effect...

So, the main problem is the auto-increment of the ID field, it should work like pböttcher wrote about...

Thank you in advance for any new suggestions!

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Hide ID field in the detail view

Post by pbottcher » 2021-07-05 16:53

Hi,
actually AppGini tries to recognize the fields. So if you CSV field contains the fieldnames as first line, it should work straight forward.

Did you check on the database side if the autoincrement is set for the ID field?
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

sblasic
Veteran Member
Posts: 53
Joined: 2021-02-22 15:55

Re: Hide ID field in the detail view

Post by sblasic » 2021-07-06 08:24

@ pböttcher

The CSV file has the first column (first field) named "id" - so the AG should recognize this field upon the import...
Since it was not the case - I have set the ID field manually - as suggested above (screen shot below) - and auto-increment of the ID field works as it should...
id_setup.png
id_setup.png (41.58 KiB) Viewed 1919 times
I have watched the tutorial videos - there is no reference that the ID field will be set-up automatically by the AG...if this is the case only in the newest versions, I really don't know why it's not working for me...

Anyways, thank you pböttcher and all of you for your help!

Cheers!

Post Reply