Forum Discussion
Hello JanosIT,
If possible could you provide a sample structure of the data that gets in the Salesforce Create snap?
If so, it would be easier for me to try to help you with the needed JSON formatting.
Regards,
Aleksandar.
Aleksandar.
Hi Aleksandar,
The expected data structure that gets into the Salesforce Create snap should look like this:
[
{
"FName__c": "John",
"LName__c": "Smith",
"Email__c": "john.smith@abc.com",
"Phone__c": "1234567890",
"Deal__c": "a0P3L000003KTVnUAO"
},
{
"FName__c": "Jane",
"LName__c": "Taylor",
"Email__c": "jane.taylor@cba.com",
"Phone__c": "0987654321",
"Deal__c": "a0P3L000003KTVnUAO"
}
]
So basically I want to retain the original structure of that particular "Contacts" part of the JSON, to insert it as separate child objects after adding the a new field (the ID of the parent) to each records, but when I use the Mapper snap to replace the keys with Salesforce fields, I get this:
[
{
"FName__c":["John","Jane"],
"LName__c":["Smith","Taylor"],
"Email__c":["john.smith@abc.com","jane.taylor@cba.com"],
"Phone__c":["1234567890","0987654321"],
"Deal__c": "a0P3L000003KTVnUAO"
}
]
Can you include the expressions that you are trying? Are you using Date.parse() to convert the string into a Date object?
The following is working for me:
Date.parse("6/15/2017")
After you have the Date objects, you should be able to compare them with the usual comparison operators (e.g. less-than, greater-than, …). For example, to compare a date against the current time:
$mydate < Date.now() ? "past" : "future"