forcedotcom / SFDX-Data-Move-Utility

SFDMU is a cutting-edge Salesforce data migration tool for seamless org population from other orgs or CSV files. It handles all CRUD operations on multiple related objects in one go.
BSD 3-Clause "New" or "Revised" License
451 stars 76 forks source link

How to replace last four digit number from asterik using SFDMU Tool #668

Closed GouravSFDMUTOOL closed 11 months ago

GouravSFDMUTOOL commented 11 months ago

Dear team ,

I have raised the issue #666 based on your latest comments you said that, Thank you for contacting me. Unfortunately, the Data Anonymization feature does not support this functionality. However, you can achieve the desired outcome by using the Regex Replacement or JS Eval Replacement options available in the Value Mapping feature. For more information and guidance, please refer to this link: https://help.sfdmu.com/full-documentation/advanced-features/values-mapping.

Then I have go through this URL .

I have few questions for the same. Please find the word document for your [reference.] Regards Gourav Narula

GouravSFDMUTOOL commented 11 months ago

I am trying to attached the document but not able to do that.

refer the document

hknokh2 commented 11 months ago

Not able to open the document

GouravSFDMUTOOL commented 11 months ago

Hey I have uploaded again can you please try to open it.

Regards Gourav Narula

GouravSFDMUTOOL commented 11 months ago

This is my Value Mapping CSV File where I have mentioned the ObjectName, FieldName, RawValue, Value. Please check if it is fine I have one more question in RawValue I have added the Regex and Value I have just added $1. Please have a look in the attachment. still is not working can you please check how it will work. Or it possible we can meet via meeting on google . Regards Gourav Narula

hknokh2 commented 11 months ago

Hi! Try to take the csv string values into double quotes: ObjectName,FieldName,RawValue,Value Contact,Phone,"/^(\d*)\d{4}$/","$1****"

hknokh2 commented 11 months ago

I've reviewed the value mapping:

  1. In your situation, double quotes in the values aren't necessary; my previous post was incorrect on this.
  2. It appears your regex expression doesn't match your phone values. The pattern /^(\d*)\d{4}$/ only matches digits, but it seems your phone numbers contain other characters. Please adjust the expression to fit your actual phone number format.
  3. Here are my tests that worked perfectly:

export.json

{
    "objects": [
        {
            "query": "SELECT Id, Phone FROM Account WHERE Name = 'ACC_10000'",
            "operation": "Upsert",
            "useValuesMapping": true,
            "externalId": "Name"
        }
    ]
}

ValueMapping.csv

ObjectName,FieldName,RawValue,Value
Account,Phone,/^(.*)\d{4}$/,$1****

Source phone value: image

Target phone value after value mapping applied: image

There is no issue found. Please retry at your end.

GouravSFDMUTOOL commented 11 months ago

Hey hknokh,

Thanks for the response.

  1. I have did the same thing which you suggested.
  2. Please check my query on Contact

{

"objects": [

    {

        "operation": "Upsert",

        "externalId": "Name",

        "fieldMapping": [

            {

                "targetObject": "Contact"

            },

            {

                "sourceField": "Phone",

                "targetField": "Phone"

            }

        ],

        "useValuesMapping": true,

        "query": "SELECT APTS_Active_Signatory__c, APTS_Job_Title__c, ASH_User_ID__c, Amadeus_Terms_Conditions_Accepted__c, Central_Account__c, Contact_Organization__c, Contact_Status__c, Corporate_Title__c, Cost_Centre__c, DOZISF__ZoomInfo_Company_ID__c, DOZISF__ZoomInfo_First_Updated__c, DOZISF__ZoomInfo_Id__c, DOZISF__ZoomInfo_Last_Updated__c, Digitally_reachable_contact__c, Eloqua_ID__c, Functional_Area__c, Impression__c, Influence__c, LID__LinkedIn_Company_Id__c, LID__LinkedIn_Member_Token__c, Last_ASH_Login__c, Location__Latitude__s, Location__Longitude__s, Nurtured_by_Marketing__c, OVCX_SalesRep_Id__c, Other_Corporate_Title__c, Partner_External_Contact_Id__c, Personal_ID__c, Placement__c, Preferred_Language__c, Role__c, Sales_Playbook_Engagement__c, Seniority_Level__c, Siebel_Container_ID__c, Siebel_ID__c, Source_detailed_type__c, TCH_ASH_User__c, TCH_Contact_Method__c, TCH_Container_ID__c, TCH_Country__c, TCH_Gender_Picklist__c, TCH_Integration_Siebel_Error_Flag__c, TCH_Integration_Siebel_Error_Message__c, TCH_Invalid_Reasons__c, TCH_Job_Area__c, TCH_Job_Position__c, TCH_LSS_Id__c, TCH_Me_Loyalty_number__c, TCH_Not_Mark_for_Deletion__c, TCH_Organization__c, TCH_Phone__c, TCH_Primary__c, TCH_Registered_to_Amadeus_Direct__c, TCH_Registration_Date__c, TCH_SalesCadenceId__c, TCH_Sign__c, TCH_Solution_of_Interest__c, TCH_Sync_To_Siebel__c, TCH_TimeZone__c, Terms_Conditions_Accepted_Date__c, appirio_core__Last_Access_Date__c, appirio_core__Licensed_Features__c, appirio_core__PIN__c, iFAO_Id__c, integrationErrorFlag__c, integrationErrorMessage__c, lastIntegrationRun__c, pse__API_Resource_Correlation_Id__c, pse__Action_Calculate_Utilization__c, pse__Action_Update_Current_Time_Period__c, pse__Actuals_Last_Update_Date__c, pse__Allow_Timecards_Without_Assignment__c, pse__Billable_External_Hours__c, pse__Billable_Internal_Hours__c, pse__Billed__c, pse__Billings__c, pse__Bookings__c, pse__Credited_Non_Billable_Internal_Hours__c, pse__Current_Time_Period_End_Date__c, pse__Daily_Default_Cost_Rate__c, pse__Default_Cost_Rate__c, pse__ERP_Worker_Correlation_Id__c, pse__Employment_Status_Effective_Date__c, pse__Employment_Status__c, pse__Exclude_From_Missing_Timecards__c, pse__Exclude_From_Time_Calculations__c, pse__Exclude_From_Time_Variance__c, pse__Exclude_from_Resource_Planner__c, pse__Excluded_Hours__c, pse__Expense_Budget__c, pse__Expense_Costs__c, pse__External_Costs__c, pse__External_Resource__c, pse__Hist_Sch_Utilization_Billable_Hours__c, pse__Hist_Sch_Utilization_Credited_Hours__c, pse__Hist_Sch_Utilization_Excluded_Hours__c, pse__Hist_Sch_Utilization_Held_Hours__c, pse__Hist_Sch_Utilization_Non_Billable_Hrs__c, pse__Historical_Utilization_Billable_Hours__c, pse__Historical_Utilization_Calendar_Hours__c, pse__Historical_Utilization_Credited_Hours__c, pse__Historical_Utilization_Excluded_Hours__c, pse__Historical_Utilization_Non_Billable_Hrs__c, pse__Historical_Utilization_Target_Hours__c, pse__Historical_Utilization__c, pse__Internal_Budget__c, pse__Internal_Costs__c, pse__Invoiced__c, pse__Is_Resource_Active__c, pse__Is_Resource__c, pse__Jira_Correlation_Username__c, pse__Languages__c, pse__Last_Date__c, pse__Latitude_PSA__c, pse__Level__c, pse__Longitude_PSA__c, pse__Non_Billable_External_Hours__c, pse__Non_Billable_Internal_Hours__c, pse__Other_Costs__c, pse__Pass_Through_Billings__c, pse__Pre_Billed__c, pse__Resource_Role__c, pse__Revenue__c, pse__Scheduled_Utilization_Billable_Hours__c, pse__Scheduled_Utilization_Calendar_Hours__c, pse__Scheduled_Utilization_Credited_Hours__c, pse__Scheduled_Utilization_Excluded_Hours__c, pse__Scheduled_Utilization_Held_Hours__c, pse__Scheduled_Utilization_Non_Billable_Hrs__c, pse__Scheduled_Utilization_Target_Hours__c, pse__Scheduled_Utilization__c, pse__Start_Date__c, pse__Sync_with_Jira__c, pse__Total_Time_Period_Hours__c, pse__Total_Utilization__c, pse__Utilization_Calculation_Date__c, pse__Utilization_Elapsed_Hours__c, pse__Utilization_Last_Update_Date__c, pse__Utilization_Target_Hours__c, pse__Utilization_Target__c, TCH_OfficeId__c, pse__Actuals_Last_Updated_By__c, pse__Current_Time_Period__c, pse__Group__c, pse__Practice__c, pse__Region__c, pse__Salesforce_User__c, pse__Utilization_Last_Updated_By__c, pse__Work_Calendar__c, AssistantName, AssistantPhone, Birthdate, CreatedDate, CurrencyIsoCode, Department, Description, DoNotCall, Email, EmailBouncedDate, EmailBouncedReason, Fax, FirstName, FirstNameLocal, HasOptedOutOfEmail, HasOptedOutOfFax, HomePhone, Id, Jigsaw, LastModifiedDate, LastName, LastNameLocal, LeadSource, MailingCity, MailingCountry, MailingCountryCode, MailingGeocodeAccuracy, MailingLatitude, MailingLongitude, MailingPostalCode, MailingState, MailingStateCode, MailingStreet, MiddleName, MiddleNameLocal, MobilePhone, Name, OtherCity, OtherCountry, OtherCountryCode, OtherGeocodeAccuracy, OtherLatitude, OtherLongitude, OtherPhone, OtherPostalCode, OtherState, OtherStateCode, OtherStreet, Phone, Salutation, Suffix, Title, UseSalesforce FROM Contact WHERE Contact_Status__c = 'InActive' LIMIT 1"

    }

],

"promptOnMissingParentObjects": false,

"promptOnIssuesInCSVFiles": false

}

  1. I have added the same regular expression which you suggested in my Source Org this is the phone +82221271801 when I am doing the same thing still in my target org record got inserted but the phone number still same +82221271801
  2. I have one question my Value Mapping file is in CSV which one is correct and I have stored in this location. I am attaching the screen shot for your reference .
  3. I have disabled the Field Mapping option in object setting as well.
  4. I am attaching again the value mapping file and Value Mapping screen shot where this file is located, I believe the tools is not able to read the csv file.
GouravSFDMUTOOL commented 11 months ago

Value Mapping CSV File with regex expression

GouravSFDMUTOOL commented 11 months ago

If it possible can we connect via google meet

GouravSFDMUTOOL commented 11 months ago

I am attaching the ValueMapping File Location Screen Shot where my file is stored is the file location is correct can you please check

hknokh2 commented 11 months ago

Hello,

Sorry to hear that you're still having trouble getting it to work on your end. In line with our Support Policy and due to time constraints, I'm unable to provide solutions for configuration-based issues. My focus is on critical issues with the SFDMU code, or where there might be underlying errors in the plugin's code, as well as instances where the documentation may be unclear.

In your case, it seems to be a configuration error. I would suggest experimenting with the configuration to get it working correctly. Your understanding in this matter is greatly appreciated.

Best regards.

github-actions[bot] commented 11 months ago

This case has been marked as 'to-be-closed', since it has no activity for the 3 days.
It will be automatically closed in another 3 days of inactivity.

github-actions[bot] commented 11 months ago

This case has been closed, since it has no activity for the last 6 days. Feel free to reopen it, if you need more help.