Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
JayQueue
Creator
Creator

Use variables from one output in another output after replicate

Hello,

Backstory: I'm coming from FME and started using Talend since 4th of October, without a course. So bear with me 😉

Issue:

I'm reading a folder where there are 2 files, an XML and a PDF. The XML contains the metadata from that PDF (both have the same name).

Now I'm uploading that PDF with a tFileFetch but I want to pass the metadata directly with that request. Is that even possible with my job?

What I tried:

  1. Changing the order
  2. I've been looking into subJobs but I can't seem to figure it out.
  3. tSetGlobalVar

Here's my job

0695b00000KAW16AAH.png

Labels (3)
18 Replies
gjeremy1617088143

use on subjob ok from the tFileList component to the tHashInput

gjeremy1617088143

yes but you have to set one globalvar for one pdf so you have to process xml and pdf on the same iteration. here the iteration is only for the xml

gjeremy1617088143

so maybe you can do this , filelist on all xml files get the metadata values and the file name.

Stock it into a hash.

Then filelist on all pdf files make a lookup with the hash on the file name to get the pdf fields and metadata fields in the same flow then tFlowToIterate and filefetch

JayQueue
Creator
Creator
Author

Now I got this:

0695b00000KAhbUAAT.png 

I need to loop then?

JayQueue
Creator
Creator
Author

I'll go work this out, tnx:)

gjeremy1617088143

also wich values will you stock in the pdf flow ?

cause if it's just filename so after you get the xml file metadata just check if the pdf exist (it's easy if they have the same file name) with a tFileExist and if it's ok filefetch with the values you got.

tFilelist -->iterate -->fileinput XML -->xmlMap--> tSetGlobalVar -->on component ok -->fileExist -->run if fileExist is true and globalvar from xml not null--> tfilefetch

 

JayQueue
Creator
Creator
Author

I got it working! Thank you so much.

 

Here's the solution

 

0695b00000KAhy9AAD.png 

 

 

gjeremy1617088143

use a run if link instead of on component ok between fileexist and filefetch, and control the value of the EXISTS var of tFileExist is true and if value of the metadata is not null on the run if link

JayQueue
Creator
Creator
Author

My bad, it had an If. But had to rebuild my tFetch.

Thanks for noticing!