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

[Iterable Lists] - STRATCONN-4357 - Fixing "Additional traits or identifiers must be a string but it was an object." error in Iterable Lists. #2541

Merged
merged 4 commits into from
Nov 12, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ const action: ActionDefinition<Settings, Payload, AudienceSettings> = {
dataFields: {
label: 'Additional traits or identifiers',
description:
'Comma delimited list containing names of additional traits or identifiers to sync to Iterable. You will need to ensure these traits or obects are included via Event Settings >> Customized Setup.',
'Additional traits or identifiers to sync to Iterable. You will need to ensure these traits or objects are included via Event Settings > Customized Setup.',
required: false,
type: 'string'
type: 'object'
},
traitsOrProperties: {
label: 'Traits or Properties',
Expand All @@ -55,7 +55,7 @@ const action: ActionDefinition<Settings, Payload, AudienceSettings> = {
},
segmentAudienceKey: {
label: 'Segment Audience Key',
description: 'Segment Audience Key. Maps to the "Name" of the Segment node in Yahoo taxonomy',
description: 'Segment Audience Key. Maps to the Iterable List "Name" when the list is created in Iterable.',
type: 'string',
unsafe_hidden: true,
required: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ export class IterableListsClient {
if (payload.traitsOrProperties[payload.segmentAudienceKey] === true) {
const subscriber = {
email: payload?.email ?? undefined,
dataFields: payload?.dataFields?.split(',').reduce((acc: { [key: string]: unknown }, item: string) => {
acc[item.trim()] = payload.traitsOrProperties[item.trim()]
return acc
}, {}),
userId: payload?.userId ?? undefined,
preferUserId: true
} as Subscriber

if (payload?.dataFields) {
subscriber.dataFields = payload.dataFields as Record<string, null | boolean | string | number | object>
}

if (subscribersGroup.has(listId)) {
subscribersGroup.get(listId)?.push(subscriber)
} else {
Expand Down
Loading