Skip to content

Commit

Permalink
fix: only new users to have default signUp date
Browse files Browse the repository at this point in the history
  • Loading branch information
shrouti1507 committed Dec 26, 2023
1 parent 429ca71 commit 9da315c
Show file tree
Hide file tree
Showing 5 changed files with 2,725 additions and 2,410 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,7 @@
},
{
"destKey": "signUpDate",
"sourceKeys": [
"traits.signUpDate",
"context.traits.signUpDate",
"timestamp",
"originalTimestamp"
],
"sourceKeys": ["traits.signUpDate", "context.traits.signUpDate"],
"required": false,
"metadata": {
"type": "timestamp"
Expand Down
10 changes: 9 additions & 1 deletion src/v0/destinations/gainsight_px/transform.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
/* eslint-disable no-nested-ternary */
const { InstrumentationError, ConfigurationError } = require('@rudderstack/integrations-lib');
const {
InstrumentationError,
ConfigurationError,
formatTimeStamp,
} = require('@rudderstack/integrations-lib');
const { EventType } = require('../../../constants');
const {
isEmptyObject,
Expand Down Expand Up @@ -56,6 +60,10 @@ const identifyResponseBuilder = async (message, { Config }) => {
payload.firstName = fName;
payload.lastName = lName;
}
// Only for the case of new user creation, if signUpDate is not provided in traits, timestamp / originalTimestamp is mapped
if (!isPresent && !payload.signUpDate) {
payload.signUpDate = formatTimeStamp(message.timestamp || message.originalTimestamp);
}
let customAttributes = {};
customAttributes = extractCustomFields(
message,
Expand Down
1 change: 1 addition & 0 deletions src/v0/destinations/salesforce/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ async function getSalesforceIdFromPayload(
if (!email) {
throw new InstrumentationError('Invalid Email address for Lead Objet');
}
// we need to make this url dynamic this is defaulting to lead.
const leadQueryUrl = `${authorizationData.instanceUrl}/services/data/v${SF_API_VERSION}/parameterizedSearch/?q=${email}&sobject=Lead&Lead.fields=id,IsConverted,ConvertedContactId,IsDeleted`;

// request configuration will be conditional
Expand Down
Loading

0 comments on commit 9da315c

Please sign in to comment.