Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] Loop/Repeat if there is an error

Hey,
I am performing an API call that generates a file to an FTP server. My current job sleeps for some time and then runs the FTPGet component to pick up that file.
I would like to some how loop back to the sleep if the FTPGet Fails.
Ideally the trigger: On Component Error would allow me to go back to tSleep_1, but that doesn't seem possible.
Any ideas on how I could implement this functionality?
Thanks,
Brian
Labels (2)
2 Replies
alevy
Specialist
Specialist

Use tLoop -iterate-> tSleep with the following settings:
Type: While
Declaration: globalMap.put("tFTPGet_1_CURRENT_STATUS","Transfer not attempted.")
Condition: !((String)globalMap.get("tFTPGet_1_CURRENT_STATUS")).equals("File transfer OK.")
Iteration:
tFTPGet sets that globalMap variable so once the file is transferred succesfully, your loop will terminate.
Anonymous
Not applicable
Author

Thanks alevy, exactly what I was looking for.
I thought it had something to do with tLoop..