Export complete
This commit is contained in:
@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"allOrNone": true,
|
|
||||||
"objects": [
|
|
||||||
{
|
|
||||||
"query": "SELECT Id, City__c, Country__c, GeoY__c, GeoX__c, PostalCode__c, Street__c, Extension__c, HouseNo__c, FlatNo__c, Floor__c FROM SCInstalledBaseLocation__c WHERE Country__c = 'NL' limit 1",
|
|
||||||
"externalId": "Id"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"query": "SELECT Id, Name, CommissioningDate__c,InstallationDate__c,ProductEnergy__c, ProductUnitClass__c,ArticleNo__c,SerialNo__c, SerialNoException__c, ProductUnitType__c, InstalledBaseLocation__c FROM SCInstalledBase__c WHERE Country__c = 'NL' limit 1",
|
|
||||||
"externalId": "Id"
|
|
||||||
}
|
|
||||||
|
|
||||||
]
|
|
||||||
}
|
|
53
prepared_steps/1_extract_data/export.json
Normal file
53
prepared_steps/1_extract_data/export.json
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
{
|
||||||
|
"allOrNone": true,
|
||||||
|
"useSeparatedCSVFiles": true,
|
||||||
|
"pollingQueryTimeoutMs": 1000000,
|
||||||
|
"bulkApiVersion": "2.0",
|
||||||
|
"parallelRestJobs": 2,
|
||||||
|
"objectSets": [
|
||||||
|
{
|
||||||
|
"objects": [
|
||||||
|
{
|
||||||
|
"query": "SELECT Id, City__c, Country__c, GeoY__c, GeoX__c, PostalCode__c, Street__c, Extension__c, HouseNo__c, FlatNo__c, Floor__c FROM SCInstalledBaseLocation__c WHERE Country__c = 'NL'",
|
||||||
|
"externalId": "Name",
|
||||||
|
"operation": "Readonly"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},{
|
||||||
|
"objects": [
|
||||||
|
{
|
||||||
|
"query": "SELECT Id, Name, CommissioningDate__c,InstallationDate__c,ProductEnergy__c, ProductUnitClass__c,ArticleNo__c,SerialNo__c, SerialNoException__c, ProductUnitType__c, InstalledBaseLocation__c FROM SCInstalledBase__c WHERE Country__c = 'NL'",
|
||||||
|
"externalId": "Name",
|
||||||
|
"operation": "Readonly",
|
||||||
|
"excludedFromUpdateFields": ["InstalledBaseLocation__c"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},{
|
||||||
|
"objects": [
|
||||||
|
{
|
||||||
|
"query": "SELECT Id, Serialnumber FROM Asset WHERE Location.ParentLocation.Name LIKE '%NL'",
|
||||||
|
"externalId": "Name",
|
||||||
|
"operation": "Readonly"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},{
|
||||||
|
"objects": [
|
||||||
|
{
|
||||||
|
"query": "SELECT Id, Country, CountryCode, Street, City, ParentId PostalCode FROM Address WHERE CountryCode = 'NL'",
|
||||||
|
"externalId": "Name",
|
||||||
|
"operation": "Readonly",
|
||||||
|
"excludedFields": ["ParentId"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
},{
|
||||||
|
"objects": [
|
||||||
|
{
|
||||||
|
"query": "SELECT Id, ParentLocationId, Name FROM Location WHERE Name LIKE '%NL' OR ParentLocation.Name = '%NL'",
|
||||||
|
"externalId": "Name",
|
||||||
|
"operation": "Readonly"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -5,8 +5,8 @@ country_mapping = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Read the input CSV file, assuming the second row is the header
|
# Read the input CSV file, assuming the second row is the header
|
||||||
read_df = pd.read_csv('../1/SCInstalledBaseLocation__c.csv', header=0, keep_default_na=False, dtype=str)
|
read_df = pd.read_csv('../1_extract_data/SCInstalledBaseLocation__c.csv', header=0, keep_default_na=False, dtype=str)
|
||||||
read_df_ib = pd.read_csv('../1/SCInstalledBase__c.csv', header=0, keep_default_na=False, dtype=str)
|
read_df_ib = pd.read_csv('../1_extract_data/SCInstalledBase__c.csv', header=0, keep_default_na=False, dtype=str)
|
||||||
for row in read_df.to_dict('records'):
|
for row in read_df.to_dict('records'):
|
||||||
try:
|
try:
|
||||||
# Your processing logic here
|
# Your processing logic here
|
||||||
@ -154,9 +154,9 @@ print(merged_df_ib.columns)
|
|||||||
merged_df_ib.columns = ['Product2.EAN_Product_Code__c', 'FSL_1st_Ignition_Date__c', 'Id', 'InstallDate', 'Name', 'Kind_of_Energy__c', 'Kind_of_Installation__c', 'Main_Product_Group__c', 'SerialNumber', 'Serialnumber_Exception__c', 'Location.ExternalReference']
|
merged_df_ib.columns = ['Product2.EAN_Product_Code__c', 'FSL_1st_Ignition_Date__c', 'Id', 'InstallDate', 'Name', 'Kind_of_Energy__c', 'Kind_of_Installation__c', 'Main_Product_Group__c', 'SerialNumber', 'Serialnumber_Exception__c', 'Location.ExternalReference']
|
||||||
|
|
||||||
# Write each DataFrame to a separate CSV file
|
# Write each DataFrame to a separate CSV file
|
||||||
address_df.to_csv('../3/Address.csv', index=False)
|
address_df.to_csv('../3_upsert_address_and_parent_location/Address.csv', index=False)
|
||||||
parent_df.to_csv('../3/Location.csv', index=False)
|
parent_df.to_csv('../3_upsert_address_and_parent_location/Location.csv', index=False)
|
||||||
child_df.to_csv('../5/Location.csv', index=False)
|
child_df.to_csv('../5_upsert_child_location/Location.csv', index=False)
|
||||||
merged_df_ib.to_csv('../7/Asset.csv', index=False)
|
merged_df_ib.to_csv('../7_upsert_assets/Asset.csv', index=False)
|
||||||
|
|
||||||
print('Data has been successfully split into Address.csv, Parent_Location.csv, and Child_Location.csv files with duplicate checks applied.')
|
print('Data has been successfully split into Address.csv, Parent_Location.csv, and Child_Location.csv files with duplicate checks applied.')
|
@ -1,2 +0,0 @@
|
|||||||
Name,DuplicateCheck__c,IsInventoryLocation,IsMobile,LocationType
|
|
||||||
"Plantsoen de Pas 12, 6601 BK WIJCHEN, NL",false,false,false,Site
|
|
|
2
prepared_steps/7_upsert_assets/ValueMapping.csv
Normal file
2
prepared_steps/7_upsert_assets/ValueMapping.csv
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
ObjectName,FieldName,RawValue,Value
|
||||||
|
Asset,Kind_of_Energy__c,2,
|
|
Reference in New Issue
Block a user