Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Download multiple files with tFileFetch will not work

Hi!

 

I interpret an XML file with products. Each product has one or no image. The image is identified with an HTTPS URI.

"image1 (tJavaRow) prepares global variales for URI and filename so I can use them in tFileFetch.

The "run if" clause checks whether the URI is set. It yes I want to execute the tFileFetch.

 

0683p000009LzQv.png

tFileInputXML_1 iterates 2 products with 2 valid images.

The problem is that the tJavaRow componenten

The problem is that image1 (tJavaRow) is called twice (that's correct 🙂 but tFileFetch will only be called once for the second product.

In the following screenshot you see the trace output for each tJavaRow and only one Status entry for the tFileFetch.

 

0683p000009LzAI.png

Note:

If I replace the "Run if" with the "Main" connection all works fine. tFileFetch will be called twice.

The problem with that is, that if a product has no image than tFileFetch runs into an error because of an invalid URI.

 

What is the problem?

 

Thx,

Michael

Labels (4)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Got an answer that using a 'run if' connection will only execute once regardless of how many rows are processed by your main connection. 

 

 

 

View solution in original post

4 Replies
Anonymous
Not applicable
Author

Got an answer that using a 'run if' connection will only execute once regardless of how many rows are processed by your main connection. 

 

 

 
Anonymous
Not applicable
Author

The IF link will only fie once, on the completion of the component. I'm not sure about the data you are carrying through your job, but try adding a tFlowToIterate component, connect a tJava (as a dummy component) to that and then add your IF link from your tJava.

 

Your column data in your tJavaRow will be added to the globalMap using this method. So to retrieve it you will need to use a bit of Java. For a String column called URL on a row called row1, you would use the following code...

((String)globalMap.get("row1.URL"))

You will need to use the above method in your tFileFetch.

 

This works because the the tFlowToIterate converts rows to iterations. This means that the connected tJava (the dummy one) will be started and finished for every row in your data set. This will allow you to use the IF (which I assume is a conditional to decide whether to try and retrieve the file or not).

 

 

Anonymous
Not applicable
Author

This is great. It works! Thx, so much.
Jmiles1658991691
Contributor III
Contributor III

Hi @michaelsooonah michaelsooonah​ @Richard Hall​ 

 

I want to download image from sharepoint. I have tried with tFileFatch & able to download .jpeg but when I'm trying to open it then its showing me error

 

Error:- It appears that we don't support this file format

 

0695b00000UwBL6AAN.png0695b00000UwBLBAA3.png0695b00000UwBLGAA3.png0695b00000UwBLLAA3.pngdo yo have any suggestions how I can resolved this

 

Thanks!!