Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Variables for HTTP URL?

  1. #1
    Join Date
    Jun 2009
    Posts
    11

    Default Variables for HTTP URL?

    Hello. I have a job that needs to download a URL that will have a syntax something like this:

    http://www.example.com/foo.php?date=20110715

    where the "20110715" will vary from day to day. I setup a test job in Kettle like this:

    Start --> Set Variables --> HTTP

    I can use "Set Variables" to create, say, "mydate" = "20110715", then use a URL in the HTTP step like:

    http://www.example.com/foo.php?date=${mydate}

    but how can I go about setting a variable dynamically, so mydate will be "20110715" today, "20110716" tomorrow, etc?

    I thought maybe I could insert a "Scripting:JavaScript" step in the job before "HTTP", but it doesn't seem to do the same thing as the "Scripting:Modified Java Script Value" option within a Transform.

    I then thought perhaps I could create a small Transform step that would us JavaScript to generate a variable that could be returned to the Job after it completes. But it appears that variables within a Transformation are lost once that step completes?

    Thanks to anyone with a solution!

  2. #2

    Default

    Hi,

    Have a look at the transformation step: Input -> Get System Info, and make sure you set an appropriate "Variable Scope" when you Set Vars.
    Regards,

    Mark, Cloud2Land

    http://www.cloud2land.com

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.