snapation6713
2 years agoNew Contributor III
Issue using mapValues and mapKeys functions in Mapper Snap
I have data from salesforce that contain fields with a suffix of '__c' and the dates are formatted in UTC. I want to format the incoming data using the mapValue and the mapKey functions to remove the...
- 2 years ago
Try with this expression:
$.mapKeys((value, key)=>key.endsWith('__c') ? key.replace('__c','').toLowerCase() :key.toLowerCase()).mapValues((value, key) => key.toLowerCase().search("createddate") >=0 && value !=null ? Date.parse(value).toLocaleDateTimeString({"format":"yyyymmdd"}) :value)
- 2 years ago
Thank you so much! It worked!