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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
MartW
Partner - Specialist
Partner - Specialist

Python output to variable

I have a custom code block with python code that returns a python list of app id's.

[item 1, item2, item3] python sees this as an list and will loop over this list in shell. In automations I've got a code block and after that a list-variable where the output is put in.

What I find is that even tho the variable is a list the output is treated as 1 item instead of 3 therefore my call to get app information about 3 app's throws an error because it places all 3 appid's into 1 string instead of preforming the action 3 times.

 

I want to loop over the list of app id's to  get app information. 

Labels (2)
1 Solution

Accepted Solutions
MartW
Partner - Specialist
Partner - Specialist
Author

I figured it out. the list as an output in automations as mentioned above is [item 1, item2]

this is from a native print statement in python then it doesn't work.

if you add the code than it works

(don't forget to do import json)

print(json.dumps(list))

 

View solution in original post

1 Reply
MartW
Partner - Specialist
Partner - Specialist
Author

I figured it out. the list as an output in automations as mentioned above is [item 1, item2]

this is from a native print statement in python then it doesn't work.

if you add the code than it works

(don't forget to do import json)

print(json.dumps(list))