Mapping - Drop key
T
Travis Gosselin
Current scenario: Integrations are calculating the payload based on the mapping YAML, and they send all properties that are being mapped.
Suggestion: Add the ability to drop the key in the mapping configuration. This way, the integration will not override existing keys in Port, while still having the ability to map data dynamically.
Example:
protected:
if (.branch.protected != null) then .branch.protected else {DROP_KEY} end
If the object contains the branch data, then map it to the entity, and if it does not a custom operation will drop the key from the payload, not overriding the current data.
T
Travis Gosselin
Agreed, this would be helpful. Today we are creating different mappings with the same kinds that have different selectors and update only individual fields to workaround this. It would streamline mapping capability and make it much more convenient and readable. In certain exporters like GitHub Exporter, usage of inline expressions to revert to entity data has an impact on how the exporter deletes entities where this feature would be very useful (working with Omri on that).
Matan Grady
Travis Gosselin: Thank you. I agree this is indeed a possible workaround; however, it complicates the mapping and affects the ability to debug it properly.