lmontoro | 2024-11-15 14:58:11 UTC | #1
Could someone from your team assist me with a data query issue? In our Salesforce account object, I have one record with the phone number "123-456-7899" and another with "1234567899". When I pass "1234567899" to the data query, I need it to retrieve both records, regardless of whether the phone number includes dashes. I want the data action to fail because it retrieves two records, whereas it should bring both corresponding entries. My current data action only retrieves the record without dashes when I enter "1234567899". I attempted modifying the JSON to use FIND and $msdynamics.fieldSearchFilter, but I could not get the syntax right. The field "PrimaryPhoneNumber__c" is of type Phone. Below you find how I have it setup in my data action. Can you provide some guidance on how I can search against different phone standards?
Data Action Setup:
Configuration Request
{ "requestUrlTemplate": "/services/data/v37.0/query/?q=$esc.url(\"SELECT account.Account18digitID_c, account.Name, account.CCRACN_c, account.FSMarketID_c, account.CCRBusType_c, account.CCRCustomerStreet_c, account.CCRCustomerCity_c, account.CCRCustomerStateProvince_c, account.CCRCustomerZipPostalCode_c, account.CCRCustomerCountry_c, account.OperatingHours_c, account.PhoneFormulaTechc FROM Contact WHERE PrimaryPhoneNumberc = '$salesforce.escReserved(${input.PHONE_NUMBER})'\")", "requestType": "GET", "headers": { "UserAgent": "PureCloudIntegrations/1.0" }, "requestTemplate": "${input.rawRequest}" }
Response
{ "translationMap": { "account": "$.records[*].Account" }, "translationMapDefaults": {}, "successTemplate": "${account}" }
Jason_Mathison | 2024-11-15 15:22:17 UTC | #2
I haven't had to dig into salesforce queries for a while, so I don't know the answer. The way I would approach it is to google your question, and work out the details in https://workbench.developerforce.com/login.php. I find tools like workbench or postman are better places to do debugging / exploration work. Once I know exactly what I need to do, making the data action is pretty straightforward.
--Jason
lmontoro | 2024-11-15 15:36:10 UTC | #3
Thanks Jason. I tried using those and even chatGPT and have not been able to get it to work.
Jason_Mathison | 2024-11-15 16:09:53 UTC | #4
Maybe you could replace "-" with "" as described here:
https://salesforce.stackexchange.com/questions/320887/removing-surplus-characters-in-a-phone-number-column-in-marketing-cloud-using-sq
system | 2024-12-16 16:10:51 UTC | #5
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 30403