Skip to main content
Level 2
Jan 22, 2026 11:29 AM UTC

Condtional Mapping in Data Prep based on data value

When doing RAW ingestion via the HTTP API Streaming Source Connector, a source field can be mappend to multiple target field. However, there is no option to condition the mapping based on the value of the field. 

A case in point. 

If value of source field A eqauls yes, map to target field A

if value of source field A equals no, map to target field B

This cannot, to my understand, be done via calculated fields either, as you can only do if statements manipulating the value of said field, but not the mapping itself. 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

5 replies

FrederikWerner
Community Advisor
Community Advisor
Jan 22, 2026 11:47 AM UTC

Good idea! As a workaround, you could still put that logic into a calculated field to only populate it in the right cases or leave empty otherwise.

Translate
Learn more about Adobe Analytics and Customer Journey Analytics on my blogNeed help with Adobe Analytics or Customer Journey Analytics? Let's talk!
Level 4
Jan 22, 2026 12:23 PM UTC

Hi ​@j_goetze_5000 ,

 

You could try to have two mapping functions for target field A and B, and in each case the value should be a Calculated Field. In the calculated field, check if the value meets the condition for field A or B, if yes, then return, otherwise return nullify(). As per my understanding, the nullify() doesn't ingest the field/value.

You might want to try this before releasing in production.

 

Thanks!

Translate
Level 2
Jan 22, 2026 12:48 PM UTC

Hi Abie, thank you for your suggestion.

I did some digging into this, and as far as I can tell, it will not solve the issue, for two reasons. 
If nothing in the schema validation prevents null values, then it will still ingest, and potentially overwrite value that should not be overwritten. If null value causes validation to fail, the entire record will fail, which is not the desired outcome.  

Translate
Level 4
Jan 22, 2026 3:32 PM UTC

​@j_goetze_5000 
Wondering if you tried this? I read some more documentation and this seems feasible.
At the same time, to make sure your previous value is not overwritten, read that value and reassign instead of setting empty or nullify().

Also, there is no real out of the box solution for this. Practically, every calculated field maps to a particular field. Above solution is also sort of a tweak, instead of official suggestion.

 

Thanks!

Translate