Skip to content

Commit

Permalink
fix: marketo bulk upload zero and null value allowed (#3134)
Browse files Browse the repository at this point in the history
  • Loading branch information
shrouti1507 committed Feb 29, 2024
1 parent cc94bba commit 4dcbf8f
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/v0/destinations/marketo_bulk_upload/transform.js
@@ -1,4 +1,4 @@
const { InstrumentationError } = require('@rudderstack/integrations-lib');
const { InstrumentationError, isDefined } = require('@rudderstack/integrations-lib');
const {
getHashFromArray,
getFieldValueFromMessage,
Expand Down Expand Up @@ -34,7 +34,7 @@ function responseBuilderSimple(message, destination) {
// columnNames with trait's values from rudder payload
Object.keys(fieldHashmap).forEach((key) => {
const val = traits[fieldHashmap[key]];
if (val) {
if (isDefined(val)) {
payload[key] = val;
}
});
Expand Down
Expand Up @@ -502,4 +502,97 @@ export const data = [
},
},
},
{
name: 'marketo_bulk_upload',
description: 'Test 5: Any null or zero value will be passed through transform payload',
feature: 'processor',
module: 'destination',
version: 'v0',
input: {
request: {
body: [
{
message: {
type: 'identify',
traits: {
name: 'Carlo Lombard',
plan: 0,
id: null,
},
userId: 476335,
context: {
ip: '14.0.2.238',
page: {
url: 'enuffsaid.proposify.com',
path: '/settings',
method: 'POST',
referrer: 'https://enuffsaid.proposify.com/login',
},
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36',
},
rudderId: '786dfec9-jfh',
messageId: '5d9bc6e2-ekjh',
},
destination: {
ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe',
Config: {
munchkinId: 'XXXX',
clientId: 'YYYY',
clientSecret: 'ZZZZ',
columnFieldsMapping: [
{
to: 'name__c',
from: 'name',
},
{
to: 'email__c',
from: 'email',
},
{
to: 'plan__c',
from: 'plan',
},
{
to: 'id',
from: 'id',
},
],
},
},
},
],
},
},
output: {
response: {
status: 200,
body: [
{
output: {
version: '1',
type: 'REST',
method: 'POST',
endpoint: '/fileUpload',
headers: {},
params: {},
body: {
JSON: {
name__c: 'Carlo Lombard',
plan__c: 0,
id: null,
},
JSON_ARRAY: {},
XML: {},
FORM: {},
},
files: {},
userId: '',
},
statusCode: 200,
},
],
},
},
},
];

0 comments on commit 4dcbf8f

Please sign in to comment.