Allow keeping of 'id' for sf data export beta tree #3348
henrymzhao
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
On this line in the export.ts file: https://github.com/salesforcecli/plugin-data/blob/186ef2fd7bd7e16004af39509bec33b7995c78b4/src/export.ts#L210
The code is automatically ripping out any fields with name Id, or empty values, or empty arrays.
This makes sense from a data export + import perspective because Ids are unique to that org, and shouldn't be kept.
However this makes the resulting JSON file very difficult to extend if we intend to stitch together additional levels of relationships through scripting.
Currently the work around would be to create a temporary formula field that simply outputs the Id and use that to generate ReferenceIds, but this is painful when dealing with multiple objects, and especially tough in orgs that have red tape around creation of fields.
I'm asking for the
sf data export beta tree
command to include an optional flag of--save-id
, where if true it will leave the Id intact in the resulting json. Yes this will break if you import it directly as-is, but it's intended to offer developers more extensibility, and they will be responsible for cleaning up the Ids themselves.I'm happy to open a PR with this change if allowed, thanks!
Beta Was this translation helpful? Give feedback.
All reactions