I’m trying to create a Salesforce task using the Salesforce node: Resource: Task Operation: Create Status Name: Open
I have several fields (description, priority…) and some custom fields as well. When I try to set up the standard field Task type (called Type Name in n8n), n8n tries to map the value to the Salesforce property TaskSubtype, instead of simply mapping it into Type.
What is the error message (if any)?
Since TaskSubtype is a restricted pick list with different values than Type I get this error:
{“message”:“Task Subtype: bad value for restricted picklist field: my_task_value”,“errorCode”:“INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST”,“fields”:[“TaskSubtype”]}
Is it n8n property mapping wrong? Or am I missing something?
This sounds wrong indeed and the mapping happens exactly as you have described (here to be precise). Perhaps @Jon can take a look into this when he gets a chance?
Indeed the code shows Task subType to be the mapping for Task type.
Would it be possible to have the current task type renamed as task subtype and add the actual task type?
Yes, this seems like a suitable approach to me. @Jon would be our man for fixing these pesky bugs in our nodes though, so I’ll leave that decision to him.
As a workaround until a fix has been released you could consider using the HTTP Request node and manually send the correct request to Salesforce.
I’ll leave here another workaround in case someone else is interested:
Create a custom task property in salesforce (let’s say hack_task_type__c) and use that one to add the value from n8n. Then add a rule in Salesforce to copy the value from hack_task_type__c into the actual task type.