Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: How to deal with field names with dashes "-" .... eg. first-name, last-name

  1. #1
    Join Date
    Nov 2013
    Posts
    13

    Default How to deal with field names with dashes "-" .... eg. first-name, last-name

    Hi, I'm transforming XML from a web service. I have a field name called iati-identifier. When I try to use it in a "Modified Javascript Value Modification" , the script seems to think it's a minus and tells me the variable iati does not exist. How do I deal with this.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,771

    Default

    Maybe you should google and check for Javascript syntax?
    If you double-click on the field on the left panel, the field is copied on the script and it should work.
    -- Mick --

  3. #3
    Join Date
    Nov 2013
    Posts
    13

    Default

    Good suggestion, seems that indeed javascript treats the hyphen as a minus operator. I used a Select Values component to change the variable name prior to sending it to javascript. That's an awful hack

    I wonder why PDI uses javascript instead of a full fledged scripting engine like Groovy or Clojure. Perhaps it's on their todo list?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.