Hitachi Vantara Pentaho Community Forums
Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: Add variable or parameter to subjetc in a mail step

  1. #11
    Join Date
    Aug 2016
    Posts
    267

    Default

    Yes, good clarifications.

    I must insist that before trying to use variables in email step/job (either in job or transformation), first do a simple demo where the variable is created and printed to log. Once you know the variable is working, then apply email.

  2. #12

    Default

    First of all I have to say that I have no idea how to use variables in spoon, I've never had to do it, so I try this:


    First I tried to edit the name of the file with a variable.

    https://drive.google.com/open?id=12A...zwVQOCTTWcF6B2

    https://drive.google.com/open?id=1QN...I_mYJPr2ZrpsYp


    This image is the other alternative I've tried, instead of change the name of the file, personalize the subject.

    https://drive.google.com/open?id=1qw...5D68r9z9oouz9f

    How can I do it well???

    Thanks in advance.

  3. #13
    Join Date
    Nov 2009
    Posts
    678

    Default

    You cannot use in one transformation a Set Variabeles and use that variable in the same transformation.
    So in the first transformation set the variable.
    In the second transformation use that variable to create a Excel file with the variable in the name. Then you can mail that Excel file

  4. #14

  5. #15
    Join Date
    Aug 2016
    Posts
    267

    Default

    Before doing anything with emails, you have to understand how variables are working!


    In a job, create 2 transformations:

    Transformation nr. 1: Create the variable with the value you want. Use the "Set Variables" step.
    Transformation nr. 2: Use the variable that was created previously. Use the "Get Variables" step, then print to log!!!

  6. #16
    Join Date
    Apr 2008
    Posts
    4,663

    Default

    Quote Originally Posted by jficheux View Post
    That looks like it should work, but you haven't mentioned your version... Someone else noted that there were issues with variables in 8.1
    If you post the actual transformations and job on Drive, other forum members can look through it and help you understand where the issue is. Just remember to remove any connection information first!

  7. #17
    Join Date
    May 2016
    Posts
    267

    Default

    It should work, and going by the icons you are working with a old version on Pentaho, so the variables bug of 8.1 shouldn't affect you. Try adding different steps printing the variable, for example, after the variable transformation try adding the Write to file job step, and just create a text dummy file printing the variable ${FECHA} (I've just tried it in Pentaho 6.1 and it works) to see if you are setting it correctly. If the variable doesn't get printed, maybe there's some problem setting the scope of the variable. Read this blog post to see if it gives some light on your problem:
    http://diethardsteiner.blogspot.com/...variables.html
    Regards
    OS: Ubuntu 16.04 64 bits
    Java: Openjdk 1.8.0_131
    Pentaho 6.1 CE

  8. #18

    Default

    Quote Originally Posted by Sparkles View Post
    Yes, good clarifications.

    I must insist that before trying to use variables in email step/job (either in job or transformation), first do a simple demo where the variable is created and printed to log. Once you know the variable is working, then apply email.
    I've got it!!!!

    Thank you very much for all your help!!!


    Regards,

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 - 2017 Pentaho Corporation. All Rights Reserved.