From 5aaf4a6d19d276af63a7dcfddcec5206b48d77f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rene=20Ka=C3=9Feb=C3=B6hmer?= Date: Thu, 24 Apr 2025 10:46:04 +0200 Subject: [PATCH] IoT Addresses and Locations fixed --- prepared_steps/1_extract_data/command.txt | 2 +- prepared_steps/2_transform_via_script/TransformScript.py | 3 +++ .../command.txt | 2 +- .../export.json | 4 +++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/prepared_steps/1_extract_data/command.txt b/prepared_steps/1_extract_data/command.txt index ce5bd2d..b6bc7fa 100644 --- a/prepared_steps/1_extract_data/command.txt +++ b/prepared_steps/1_extract_data/command.txt @@ -1 +1 @@ -python .\extract_via_simple_salesforce.py --context qa2 \ No newline at end of file +python .\extract_via_simple_salesforce.py --context qa2 --country NL \ No newline at end of file diff --git a/prepared_steps/2_transform_via_script/TransformScript.py b/prepared_steps/2_transform_via_script/TransformScript.py index 2ece1fe..c31c614 100644 --- a/prepared_steps/2_transform_via_script/TransformScript.py +++ b/prepared_steps/2_transform_via_script/TransformScript.py @@ -59,6 +59,9 @@ merged_df_location_iot = merged_df_location_iot.drop('ParentId', axis=1) merged_df_location_iot.columns = ['Id', 'Name', 'VisitorAddressId', 'PKey__c'] +# Drop rows where VisitorAddressId is null +merged_df_location_iot = merged_df_location_iot.dropna(subset=['VisitorAddressId']) + ##--------------------------------------------------------------------------## ## Address and Location (Parent and Child) ##--------------------------------------------------------------------------## diff --git a/prepared_steps/3_update_address_and_location_data_for_migration/command.txt b/prepared_steps/3_update_address_and_location_data_for_migration/command.txt index 4c22459..0389686 100644 --- a/prepared_steps/3_update_address_and_location_data_for_migration/command.txt +++ b/prepared_steps/3_update_address_and_location_data_for_migration/command.txt @@ -1 +1 @@ -sf sfdmu run --sourceusername csvfile --targetusername rene.kasseboehmer@vaillant.de.devrene \ No newline at end of file +sf sfdmu run --sourceusername rene.kasseboehmer@vaillant.de.devrene --targetusername rene.kasseboehmer@vaillant.de.devrene \ No newline at end of file diff --git a/prepared_steps/3_update_address_and_location_data_for_migration/export.json b/prepared_steps/3_update_address_and_location_data_for_migration/export.json index e1c7878..f87b34a 100644 --- a/prepared_steps/3_update_address_and_location_data_for_migration/export.json +++ b/prepared_steps/3_update_address_and_location_data_for_migration/export.json @@ -1,9 +1,11 @@ { "allOrNone": true, + "importCSVFilesAsIs": true, "objects": [ { - "query": "SELECT Id FROM Address WHERE CountryCode = 'NL'", + "query": "SELECT Id FROM Address", "operation": "Readonly", + "externalId": "Id", "master": false },{ "query": "SELECT Id,Name,VisitorAddressId,PKey__c FROM Location",