Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: marketo bulk upload zero and null value allowed #3134

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/v0/destinations/marketo_bulk_upload/transform.js
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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,
},
],
},
},
},
];