Forum Discussion
Hi @darshthakkar,
One approach will be to Map the input document with the following expression:
$.entries().sort((a,b) => a[0].localeCompare(b[0])).reduce((acc,curr) => acc.extend({[curr[0]]:curr[1]}),{})
Note: This will only sort properties on first level.
Let me know if this helps.
BR,
Aleksandar.
- prakarshjain5103 years agoNew Contributor II
I was able to resolve the error.
Had to use the correct relationship field API Name which was something else and not Contact__r.
Thanks a lot for the help @bojanvelevski @darshthakkar
- darshthakkar3 years agoValued Contributor
Glad you were able to resolve the error. Yeah, it has happened with me before that I used a wrong mapping for salesforce fields.
Salesforce fields have a double underscore “__” and I was going ahead with a single “_”; that was not allowing me to ingest any values. Second time, I was trying to insert a name and salesforce could ONLY accept an ID for a given field, I’ve had my part of resolving those errors previously.
Rationale behind not highlighting these facts before was to check and validate if there were any erros in the pipeline design/development, the next step would anyway have been checking the mapping which you did so all good.
- darshthakkar3 years agoValued Contributor
@prakarshjain510: Are you getting any error when the pipeline gets executed or does it run completely and after validating Salesforce, you observed that the records were not ingested?
I would like to know what is your validation step and does your setup in Salesforce accept the external ID? If need arises, we can hop on a quick call to understand your use case better.
Thanks! - prakarshjain5103 years agoNew Contributor II
There was no error shown in the pipelines. In the mapper snap, I can see the id is generated for the relationship object.
Pipeline created:
In the Salesforce Created output, this is what I am getting:
Yes, the Salesforce accepts External Id field. While inserting Contact, I am doing upsert based on External Id, and it is working fine.
I had created a similar pipeline, where a junction object was getting upserted. The difference was, the junction object was child to Account and Contact.
And in this case, the relationship object is child to two Contact lookup fields.
It would be really helpful if we can jump on a call to discuss this. Appreciate all the help. Thanks!
- prakarshjain5103 years agoNew Contributor II
One more thing to add, the Salesforce Poller after Relationship Create is not giving any output. I added a Join snap after that just to check if I am getting any value in the left path of join, but I am not getting anything.
- bojanvelevski3 years agoValued Contributor
Hi @prakarshjain510,
Check if your last snap is set to Validate & Execute. That will result in the scenario above.