Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
DavidFosterVF
Creator
Creator

Problem reading QRS API dataconnection in Python

Hi

In Python, I am struggling to print out the connectionstring value of a dataconnection. I think the problem is that the connection strings are full of brackets and commas, making python interpret it as json structure not values.

Any suggestions how I can python to read the connectionstring as a simple value?

Labels (1)
  • API

1 Solution

Accepted Solutions
DavidFosterVF
Creator
Creator
Author

Turned out i should be using the json.loads (i.e. load string) which reads the json into a python dictionary and the connectionstring was correctly read as a single value.

View solution in original post

3 Replies
NadiaB
Support
Support

Hi @DavidFosterVF

I'm not python expert but according to this post it would be r Prefix:

https://stackoverflow.com/questions/4703516/how-to-write-string-literals-in-python-without-having-to...

https://www.pythontutorial.net/python-basics/python-raw-strings/#:~:text=In%20Python%2C%20when%20you....

Let us know if it works. 

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm
DavidFosterVF
Creator
Creator
Author

Turned out i should be using the json.loads (i.e. load string) which reads the json into a python dictionary and the connectionstring was correctly read as a single value.

NadiaB
Support
Support

Thanks for sharing the resolution @DavidFosterVF for the python code issue.

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm