Problem import data with different Table id in my excel

Hi All,


I am facing one problem when READ the EXCEL and CREATE_AAA  the ID not same as my excel ID no.

Any idea how to turn off, and using the Table ID with my excel?


Let say I need to move the Environment from A to B. So need to move the package of project.

For the Data, i extract to excel. 

Then, in the Environment B, i create a screen to read the excel and import.

Everything fine, but i notice the Table of id not same as what i put in excel. Look like it is auto generate and assign ID for me.

How can i avoid this problem? can i turn off anything and import the data with 100% same as my excel?


example:

Excel 

No    Name  Age   Car

1       LALA   15     TOYOTA

2       NANA   18    HONDA


After create data

No     Name       Age     Car

2       NANA        18       HONDA

1       LALA         15       TOYOTA


I have hundred thousand record need to import and many tables.

I need to import 100% same.


Anyone can help me?


Thank you



jing tung wong wrote:

Hi All,


I am facing one problem when READ the EXCEL and CREATE_AAA  the ID not same as my excel ID no.

Any idea how to turn off, and using the Table ID with my excel?


Let say I need to move the Environment from A to B. So need to move the package of project.

For the Data, i extract to excel. 

Then, in the Environment B, i create a screen to read the excel and import.

Everything fine, but i notice the Table of id not same as what i put in excel. Look like it is auto generate and assign ID for me.

How can i avoid this problem? can i turn off anything and import the data with 100% same as my excel?


example:

Excel 

No    Name  Age   Car

1       LALA   15     TOYOTA

2       NANA   18    HONDA


After create data

No     Name       Age     Car

2       NANA        18       HONDA

1       LALA         15       TOYOTA


I have hundred thousand record need to import and many tables.

I need to import 100% same.


Anyone can help me?


Thank you



 Hi jing tung wong


From what you wrote is my understanding that you used an upload widget to get the excel data and after you add it to your database the Id is different than the one you set on the excel ("No" column, right?)? 

If it is like this the only thing that you need to do is to change the Autonumber property of your ID database entity to "No" - by default the autonumber is set to Yes. 

Then when you are creating a record to the database entity the action will ask you for the ID value - which you will assign as the one from the "No" column from your excel.

Does this make sense to you? If you need any help just ask.

Hope it helped,

Clarisse


Clarisse Carneiro wrote:

If it is like this the only thing that you need to do is to change the Autonumber property of your ID database entity to "No" - by default the autonumber is set to Yes. 

Then when you are creating a record to the database entity the action will ask you for the ID value - which you will assign as the one from the "No" column from your excel.

Clarisse's answer addresses your concern with Ids not being the ones you have on your Excel file, but there's a consequence to this solution that is important to mention: when you do it, you will always need to explicitly assign unique Ids to any new records you create, the platform will no longer generate them automatically for you.

Although there are situations where it makes sense (and it does make data migration simpler), generally speaking, having your Ids assigned manually is not such a great idea... the possibility of mistakes increases tremendously.

Jorge Martins wrote:

Clarisse Carneiro wrote:

If it is like this the only thing that you need to do is to change the Autonumber property of your ID database entity to "No" - by default the autonumber is set to Yes. 

Then when you are creating a record to the database entity the action will ask you for the ID value - which you will assign as the one from the "No" column from your excel.

Clarisse's answer addresses your concern with Ids not being the ones you have on your Excel file, but there's a consequence to this solution that is important to mention: when you do it, you will always need to explicitly assign unique Ids to any new records you create, the platform will no longer generate them automatically for you.

Although there are situations where it makes sense (and it does make data migration simpler), generally speaking, having your Ids assigned manually is not such a great idea... the possibility of mistakes increases tremendously.

 Halo Jorge,

I just need to import the data, after import.. i will turn on to AUTO.


Thank you


Regards,

Ryan

 

Hi Clarisse's  and Jorge,


I got the error when i turn off the auto generate no.. when compile the project, i got error.


Please find the attached file.

I think you can use Entities.VISITTYPE.<StaticEntityId> to get the visit type id. 

It is better not to hardcode the static entity id in the excel. 

It can be erroneous when deploying the hardcoded static entity id into production environment.


Hi Ryan,

As you saw, AutoNumber attributes cannot be modified once they were defined, so even if you manage to set your Ids to not be AutoNumber, you wouldn't be able to enable it afterwards (that's why I mentioned the consequences of doing such a thing).

If you still want to move forward with Clarisse's idea, if you do not have any data on your entity, you can simply cut the Entity and paste it again in the same place (this pasted Entity will be stored in a different table, that will be created when you publish). Before publishing make sure you setup your AutoNumber property correctly (as you saw, once you set it and publish, you won't be able to modify it).

Hope this helps...