Import from CSV from a process - Dates & Other Issues

If you think that something doesn't work in Aware IM post your message here
Post Reply
PointsWell
Posts: 1457
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Import from CSV from a process - Dates & Other Issues

Post by PointsWell »

I am having an issue with AIM not importing dates from a CSV file. If the attribute of the BO is Required it is rejecting the whole process.

Code: Select all

BO.psCountry.ISO3,BO.EffectiveDate,BO.StartDate,BO.EndDate,BO.Name,BOTaxDescription,
"ALB",            2006-01-01,      2006-01-01,  NULL,      "VAT",  "Value Added Tax"
nb spacing in the example is for readability purposes only.

My BO has a default value for StartDate of CURRENT_DATE and on the database I can see that this is setting to today's date.

I am using a genericised importation process so there is no scope for fudge work arounds on this
Last edited by PointsWell on Thu Feb 07, 2019 9:53 pm, edited 1 time in total.
idpSteve
Posts: 201
Joined: Thu Jul 27, 2017 6:13 am
Location: Johannesburg, South Africa
Contact:

Re: Import from CSV from a process

Post by idpSteve »

I've had some similar issues before. What I do now (not ideal but it works) is I import everything into a temp object as plain text attributes, and then I create the actual objects from that. I'll have a UserImport object, with DoB being plain text, then something like this:

CREATE User WITH User.DoB=AS_DATE(UserImport.DoB), ..... or something similar to that.
PointsWell
Posts: 1457
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Import from CSV from a process - Dates & Other Issues

Post by PointsWell »

Additional issues:

Importing a CSV with recursive relationship to same table:
- Consider a (simplified) parts manifest, where one part may contain another part the BO would look like:

PartsManifest.PartNo
PartsManifest.Name
PartsManifest.psContainedIn
PartsManifest.pmContain

If you tried to import the full chain by CSV you will experience unexpected NULL values for a part that is not contained in anything eg.

Code: Select all

PartsManifest.PartNo, PartsManfest.Name, PartManifest.psContainedIn.Code
0001,                 Car,               NULL,
3000,                 Engine,            0001,
3100,                 Gearbox,           3000,          
This does not produce a table like this:

Code: Select all

PartNo, Name,   Code
0001,   Car, 
3000,   Engine, 0001  
But instead creates another NULL record and tries to associate the 0001 with it like this:

Code: Select all

PartNo, Name,   Code
NULL,   NULL,   NULL  
0001,   Car,    NULL 
3000,   Engine, 0001  
Load records without a relationship first and without the psContainedIn relationship at all, AIM will not understand NULL for this attribute type
aware_support
Posts: 7523
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: Import from CSV from a process - Dates & Other Issues

Post by aware_support »

Your original report - what is the problem? The fact that dates are not imported or that the field is required?

Dates may not be imported if their format is different from the one defined in the BSV. You can specify the format in the header, like so:
BO.psCountry.ISO3,BO.EffectiveDate yyyy-dd-MM,BO.StartDate,BO.EndDate,BO.Name,BOTaxDescription,
Aware IM Support Team
Post Reply