I’m running into an interesting issue trying to us...
# support
s
I’m running into an interesting issue trying to use a reverse ETL from snowflake to mixpanel, and would appreciate any help/guidance. There are shared properties between the events I’m loading from the reverse ETL and the events we send via JS. But the property keys in JS are lowercase and the property keys (column names) in the reverse ETL are uppercase so they do not match. I tried to merge them in Mixpanel’s lexicon functionality, and it works somewhat, but because I’m using one property key as a group analytics key they don’t fully support merging. So the question I have is how do I lowercase names coming out of the snowflake reverse etl before sending to Mixpanel. I tried being explicit in the model and it still didn’t work, as can be seen in the attached screenshot.
s
Copy code
export function transformEvent(event, metadata) {
  const meta = metadata(event);
  const sourceId = meta.sourceId;
// Filter the event from the reverse etl source
  if(sourceId === "<Reverse_ETL_Source_id>") {
    if (event.payload) {
      event.payload.lowercasekey = event.payload.uppercasekey;
      delete event.payload.uppercasekey;
    }
  }
  return event;
}
Something on these lines
s
ok, I’ll take a look at that thanks
@shy-kite-21035 I’m trying to implement this but running into issues. When I’m writing a transformation and running tests should I be able to write to the logs?
i can’t seem to get any output even just doing a simple console.log
Ok I got it to work, but the logs still don’t seem to do what I was looking for
for reference here is the function I’m using
Copy code
export function transformEvent(event) {
    if (event.properties) {
        const keys = Object.keys(event.properties);
        if (keys) {
            keys.forEach(key => {
                if (event.properties[key]) {
                        event.properties[key.toLowerCase()] = event.properties[key]
                        delete event.properties[key];
                    } 
            })
        }
    }
    return event;
}
I assumed if I used
console.log()
it would print something here
but that doesn’t seem to be the case
ah ok that worked, thanks