Data Disappearing after Converting default Field to Look-Up Field

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
jrcervantest
Veteran Member
Posts: 32
Joined: 2020-06-22 00:00

Data Disappearing after Converting default Field to Look-Up Field

Post by jrcervantest » 2020-06-22 20:37

Request assistance for the following dilemma. I’ve searched the forum for a similar issue, but no success. I’m a new user to AppGini, so your help is much appreciated.

- I imported several .csv file – no issues
- I re-titled the table and field names and assigned appropriate primary keys – no issues

All the new data displayed correctly within the tables, detail views and the PHPmyAdmin Server.

- I then selected a field from one of the tables and converted it to a drop-down lookup field with a parent table and associated parent caption field.

This is where I experienced an ISSUE!

-The data disappeared (for that field) after converting it to a drop-down. However, the data was still contained in the SQL database. In fact, all the fields that were converted over to look-up fields no longer displayed the imported data but the data was still in SQL Server.
-What am I overlooking? Did I miss something during the configuration set-up? Please help!

Thank you for your assist,
~Tony

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

Re: Data Disappearing after Converting default Field to Look-Up Field

Post by pbottcher » 2020-06-22 20:57

Hi,
a lookup field is not a reference to the data itself, but to the PK of the refering table.

e.g.

Table 1

id 1 Value a
id 2 Value b

Table 2
display b

id you replace the display of table be to be a lookup to table 1 , the value should be 2 and not b anymore. So in your HTML view you will see no value, as the reference from b is not found in Table 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.

jrcervantest
Veteran Member
Posts: 32
Joined: 2020-06-22 00:00

Re: Data Disappearing after Converting default Field to Look-Up Field

Post by jrcervantest » 2020-06-22 21:36

Pböttcher,

Thank you for the quick reply Sir! I understand the relationship you provided as an example. I believe I set the field up correctly. In fact, I also reviewed the sample video on the AppGini site just to make sure. https://bigprof.com/appgini/help/workin ... kup-fields.

The data in the drop down is displaying. That’s not the issue. The issue is the original data (existing data) that came from the .csv import in the non-parent table. It is no longer visible in the field after converting it to a drop-down field. For example,

Field 1 (before conversion to drop-down) contains existing data (e.g, “WXYZ”)
Field 1 (after conversion do drop-down) original data is now gone (Blank Field) But the Drop-Down works well. (not the issue & I can see the data from the parent table in the drop-down field.) However, what happened to my original data that was sitting in the field before I converted the field to a drop-down?

jrcervantest
Veteran Member
Posts: 32
Joined: 2020-06-22 00:00

Re: Data Disappearing after Converting default Field to Look-Up Field

Post by jrcervantest » 2020-06-23 01:43

*******************PROBLEM SOLVED! **********************
First off, it was operator error :( (my doing). That said, I’m learning as I go…

So, I’m still not quite certain if this current set-up is the standard, but it worked.

PROBLEM
In the parent table (list of items from the drop-down) I created it by importing the list from a .csv file. In that list, I had several columns, one of which was an existing id column. After importing the list, I set the id column (field) as my primary key then began the conversion process of creating a drop-down field from the main record and linking it to the parent list table that I just created. Shortly after regenerating AppGini (button w/magic wand), I went to the Detail View to see the form and noticed that the existing data from the main record in the new drop-down field was gone. Not the data from the drop-down list, but from the main record.

SOLUTION
The newly converted drop-down list that failed to display the pre-existing data from the main record (VarChar) appeared blank because it was conflicting with the datatype from the primary key (Integer). After deleting the id primary key and reassigning it to the title field, all of the data from the record reappeared in the drop-down field. It worked! Thank you all, for your support!

Post Reply