diff --git a/apps/salesforce/bundle/bots/load/salesforce_load/bot.ts b/apps/salesforce/bundle/bots/load/salesforce_load/bot.ts index 5c4f4c5..70026c8 100644 --- a/apps/salesforce/bundle/bots/load/salesforce_load/bot.ts +++ b/apps/salesforce/bundle/bots/load/salesforce_load/bot.ts @@ -73,7 +73,23 @@ export default function salesforce_load(bot: LoadBotApi) { // Ignore special fields if (sfField === "attributes") return acc const uesioName = uesioFieldsBySalesforceName[sfField] - if (!uesioName) return acc + if (!uesioName) { + // Special handling for sf reference fields + // example: Project__r.Name + if (typeof value === "object") { + acc = { + ...acc, + ...createUesioItemFromSalesforceRecord( + Object.fromEntries( + Object.entries( + value as Record + ).map(([k, v]) => [sfField + "." + k, v]) + ) as Record + ), + } + } + return acc + } if (value !== null && value !== undefined) { const fieldMetadata = collectionMetadata.getFieldMetadata(uesioName)