Skip to content

Instantly share code, notes, and snippets.

@winniecluk
Created March 22, 2018 16:54
Show Gist options
  • Save winniecluk/3a79b7a5dacdb7eec2a051b8b70662b5 to your computer and use it in GitHub Desktop.
Save winniecluk/3a79b7a5dacdb7eec2a051b8b70662b5 to your computer and use it in GitHub Desktop.
"[{\"salesforceId\":\"0010m00000CMHoUAAX\",\"Id\":\"0010m00000CMHoUAAX\",\"UniqueId__c\":\"practice-43\",\"Type\":\"Practice\",\"Website\":\"https://revelar-yanpix-portal-practitioner.azurewebsites.net\",\"Phone\":\"(592)-250-3249\",\"Email__c\":\"WillyWanka@dispostable.com\",\"Name\":\"Willy Wanka's Neverland\",\"attributes\":{\"url\":\"/services/data/v42.0/sobjects/Account/0010m00000CMHoUAAX\",\"type\":\"Account\"}},{\"salesforceId\":\"0010m00000CN7doAAD\",\"Id\":\"0010m00000CN7doAAD\",\"ParentId\":\"0010m00000CMHoUAAX\",\"UniqueId__c\":\"clinic-49\",\"Type\":\"Clinic\",\"ShippingState\":\"OR\",\"ShippingPostalCode\":\"97215\",\"ShippingCountry\":\"USA\",\"Phone\":\"(850) 508-0838\",\"Email__c\":\"\",\"Name\":\"Willy Wanka's playhouse\",\"attributes\":{\"url\":\"/services/data/v42.0/sobjects/Account/0010m00000CN7doAAD\",\"type\":\"Account\"}},{\"salesforceId\":\"0030m00000C5nX8AAJ\",\"Id\":\"0030m00000C5nX8AAJ\",\"AccountId\":\"0010m00000CMHoUAAX\",\"UniqueId__c\":\"practitioner-92\",\"ContactType__c\":\"Practitioner\",\"Is_Practice_Manager__c\":false,\"LastName\":\"Wankah\",\"MiddleName\":\"\",\"FirstName\":\"Willy\",\"attributes\":{\"url\":\"/services/data/v42.0/sobjects/Contact/0030m00000C5nX8AAJ\",\"type\":\"Contact\"}},{\"salesforceId\":\"02i0m000000A9K7AAK\",\"Id\":\"02i0m000000A9K7AAK\",\"AccountId\":\"0010m00000CMHoUAAX\",\"Name\":\"Test\",\"SerialNumber\":\"f56fbbd3-0dbe-fd34-1c52-e377be5c2049\",\"attributes\":{\"url\":\"/services/data/v42.0/sobjects/Asset/02i0m000000A9K7AAK\",\"type\":\"Asset\"}}]"
@germ13
Copy link

germ13 commented Mar 22, 2018

Ask her to do this to the json string/data shes receiving:

// json data cleanup.  not elegant, but it works:
string jsonString = Salesforce.GetMyJson(); // fill in code to get endpoint
jsonString = jsonString.Replace("\\", "");      // Remove reverse slashes
jsonString = jsonString.Substring(1);           // Remove first double-quote
jsonString = jsonString.Substring(0, jsonString.Length - 1); //Remove last double-quote

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment