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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tForEach - cant capture values

Hello,

IM trying to use tForEach to iterate over a set of values and write these values along with some context variables to a file.  I want each row of the ForEach to result in a new line in the target file.    I want the value of ForEach to get used and then concatenate a globalMap Variable and a context variable to that value before writing it as a line.
IM set up like this:

tForEach-->tIteratetoFlow->tFileOutputExcel
I have a list of values set up in my ForEach and a column set up in the IterateToFlow and Excel file.   The column in Iterate to Flow has this in its value

globalMap.get("tForeach_1_CURRENT_VALUE")


Every time i run I error with this on the For Each


Error Line: 602
Detail Message: Type mismatch: cannot convert from Object to String



What am i doing wrong?   Should i be using tJavaRow or tJavaFlexInstead?

If so , what is the general method?

Labels (2)
1 Reply
Anonymous
Not applicable
Author

Hi 
Set the expression as:
((String)globalMap.get("tForeach_1_CURRENT_VALUE"))

Regards
Shong