Solved

JQL- Convert string to lowercase

  • 27 August 2020
  • 4 replies
  • 189 views

It seems .tolowercase() method from javascript does not work in Mixpanel. How do I convert a string to lowercase?

icon

Best answer by robin 27 August 2020, 18:56

function main() {
  return Events({
    from_date: '2020-08-26',
    to_date:   '2020-08-27'
  }).map((e) => { return e.name.toLowerCase() });
}

 

Lower case works fine here, I tested

View original

4 replies

Userlevel 3
Badge +3

function main() {
  return Events({
    from_date: '2020-08-26',
    to_date:   '2020-08-27'
  }).map((e) => { return e.name.toLowerCase() });
}

 

Lower case works fine here, I tested

The code works fine with event name for me. But does not work for an event property

but the below works gives a string columns as output-

function main() {
  return Events({
    from_date: '2020-08-26',
    to_date:   '2020-08-27',
    event_selectors:[{event:'mediaReady'}]
  }).map((e) => { return e.properties["assetType"] })

}

Userlevel 3
Badge +3

Are all your properties defined? The error seems to show that some of them are undefined

Sorry my bad. The properties were not defined for some of the events. Worked alright with a try catch. Thanks for the answer.

Reply


Mixpanel