Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: How to extract only on column of the "Get File Names" results?

  1. #1
    Join Date
    Dec 2016
    Posts
    23

    Default How to extract only on column of the "Get File Names" results?

    Hi,

    I need to send an email but I'm using the filename or uri from "Get File Names to get the attachment, and then the destination, sender, port, server and others are coming from "add constants" but when I connect both to the send mail appears this error:

    "The name of field number 1 is not the same as in the first row received: you're mixing rows with different layout. Field [File content String] does not have the same name as field [filename String(500)]."


    How can I extract the fieldname column or or the uri field correctly? I use "select values" but I received the message again, maybe I'm using it in a wrong way.

    or you know any other better way to unify these 2 different process?

    Thanks

  2. #2
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Don't use a separate hop for Add-Constants, just add fields to the rows coming from Get-File-Names:

    Name:  230384.png
Views: 61
Size:  6.1 KB
    So long, and thanks for all the fish.

  3. #3
    Join Date
    Dec 2016
    Posts
    23

    Default

    Hi,

    I will show the full process:

    Name:  transformation.jpg
Views: 62
Size:  6.1 KB

    1-first I'm reading a JSON file
    2-then I'm sending the information to a web service
    3-then I need to extract some information from the REST Client results
    4-destination, sender, port, server are the constants
    5-subject is a concatenation between a constant and the Modified Java Script output
    6-I extract the file I need to send
    7-send the file

    In this order (Where Get File Names is after the rest items) the issue now is that it can't find any value before "Get File Names"

    Error Message: "We can not find destination field [destination] in input stream!"

    However when "Get File Names" is before the rest items, the issue now is that it can't find any value before "Get File Names".
    Error Message: "We can not find source filename field [uri]"

    I'm testing putting "Get File Names" before "Load file content in memory", where do you think I should put it? or how can I improve this process?

    Thanks!

  4. #4
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    There's a reason why Get-File-Names is categorized as an input step.
    Usually, this step is a starting step in your graph.
    Folder, file mask and extension can be supplied upstream for convenience, if you choose so.
    Anyway, you won't find incoming fields downstream unless there's a "pass through" option in your input step.
    Rethink your solution, separate streams by purpose, eventually join rows, and you'll be fine.

  5. #5
    Join Date
    Dec 2016
    Posts
    23

    Default

    Hi, thanks, I rethink the solution and it's working.
    Thanks for your help!

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.