Draft
Fix embedded object exports failing due to unresolved namespace tokens in filter evaluation#475
Conversation
Vlocity exports were failing with "Filter evaluated to empty object for embedded object %vlocity_namespace%__Element__c on OmniScript__c" because the filter evaluation code in the new local exporter did not resolve the %vlocity_namespace% placeholder tokens before: 1. Looking up values in the context object (evalFilterValueExp) – the context is keyed by the real resolved namespace (e.g. vlocity_cmt__OmniScript__c) but the filter template still contained the raw token, so every path lookup returned undefined. 2. Using filter object keys as Salesforce field names (buildLookupFilter) – the keys were passed to Salesforce queries with the raw token instead of the actual field name. Fix: call this.salesforce.updateNamespace() on the filter string template in evalFilterValueExp and on each filter object key in buildLookupFilter. Also adds updateNamespace to every inline salesforce mock in datapackExporter.test.ts and a dedicated test case for namespace token resolution in filter keys and values. Closes #474
Copilot
AI
changed the title
[WIP] Fix Vlocity exports issues on version 2.4.1
Fix embedded object exports failing due to unresolved namespace tokens in filter evaluation
Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Exporting OmniScripts (and other datapacks with embedded objects) fails with
Filter evaluated to empty object for embedded object %vlocity_namespace%__Element__cbecause the new local exporter never resolves%vlocity_namespace%placeholders before evaluating embedded-object filters.Root cause
Export definitions use
%vlocity_namespace%tokens in both filter keys and values:evalFilterValueExpbuilds a lookup context keyed by the real resolved type (e.g.vlocity_cmt__OmniScript__c), socontext['%vlocity_namespace%__OmniScript__c']always returnsundefined→ filter collapses to empty → exception. Filter object keys (%vlocity_namespace%__OmniScriptId__c) were also forwarded unresolved to Salesforce queries.Changes
datapackExporter.ts—evalFilterValueExp: callthis.salesforce.updateNamespace(stringFormat)before the context lookup so path segments match the resolved object type keys.datapackExporter.ts—buildLookupFilter: resolve namespace tokens in each filter object key viathis.salesforce.updateNamespace(key)before building the query filter.datapackExporter.test.ts: addupdateNamespacemock to all three inlinesalesforcemocks; add a dedicated test verifying namespace token resolution in both filter keys and values.