TaskSubtype field wrong mapping - Salesforce task creation

Describe the issue/error/question

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?

Information on your n8n setup

  • n8n version: 0.186.1
  • Running n8n via: n8n.cloud

Hi @Sir_Pompas, welcome to the community!

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?

Hi @MutedJam
Thank you for your answer!

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?

Thanks :call_me_hand:

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.

Sounds good!

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.

1 Like

Hey @Sir_Pompas,

I have created an internal ticket for this one which will be tracked as N8N-4930, As soon as I have had a chance to take a look I will let you know.