Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
peter_nbc
Contributor II
Contributor II

Dynamic token handling - "With connection" failing

Hi

I am currently facing a challenge in my Qlik Cloud environment related to the usage of the "with connection" statement.

I have a Qlik script where I obtain an access token, and I need to dynamically update subsequent REST connector calls with this token, as it otherwise expires every hour if I hard code it. I've noticed that the "with connection" feature is not working in my Qlik Cloud environment, preventing me from dynamically modifying the connection string within the script. It gives me this error:

------

The following error occurred:
(Connector error: "WITH CONNECTION" is not allowed. To allow
"WITH CONNECTION", select Allow "WITH CONNECTION" in the
connector settings.)

-------

Is the use of the "with connection" feature supported in Qlik Cloud? If not, are there alternative methods or best practices to dynamically update the connection string in Qlik Cloud scripts to handle scenarios like token expiration in REST APIs?

Thanks in advance.

Labels (2)
2 Solutions

Accepted Solutions
peter_nbc
Contributor II
Contributor II
Author

Hi @Albert_Candelario 

I am sorry, but I hadn't seen that the solution was very simple.

There is a check box in the rest connector settings, that I can just tick, and now it all works.

Thanks a lot 🙂

Best,
Peter 

View solution in original post

Albert_Candelario

Excellent, that is what I wanted to confirm, if the setting was marked or not.

 

Thanks for sharing @peter_nbc 

Please, remember to mark the thread as solved once getting the correct answer

View solution in original post

8 Replies
anat
Master
Master

peter_nbc
Contributor II
Contributor II
Author

Hi @anat 

Thanks a lot for the link.

Bit this is only regarding Qlik Sense Enterprise, correct?
I don't think I can use that solution in Qlik Cloud?

Best,
Peter

Albert_Candelario

Hello  @peter_nbc,

You mean that you are using the feature on Qlik Cloud as below and is not working for you?

Albert_Candelario_0-1703758261245.png

Cheers,

Albert

 

Please, remember to mark the thread as solved once getting the correct answer
Albert_Candelario

Also please check - Using pagination with selected REST sources | Qlik Cloud Help

Select and load data from a REST data source | Qlik Connectors Help

Cheers,

Albert

Please, remember to mark the thread as solved once getting the correct answer
peter_nbc
Contributor II
Contributor II
Author

Hi @Albert_Candelario 

I have also posted in the other forum, but I will post it here as well, just in case:

----


I have attached to pictures to this post about regarding the error.

The first one is my script I am trying to load. First I get an access token (this part works fine). Then I store that access token in a variable and use it in the next rest connector using  "With connection". The reason I need this, is because the access token is only valid for 1 hour, so I need to do it this way in order to make it dynamic and make it fetch a new token every time I run the script. 

The second picture is the error message I get, when I try to run it.

Do you have any ideas on how to fix this?

Best,
Peter

 

 

Albert_Candelario

Hello @peter_nbc,

Can you also share a screenshot of the connector setting, the "Additional request parameters" section.

Thanks in advance!

Cheers,

Albert

Please, remember to mark the thread as solved once getting the correct answer
peter_nbc
Contributor II
Contributor II
Author

Hi @Albert_Candelario 

I am sorry, but I hadn't seen that the solution was very simple.

There is a check box in the rest connector settings, that I can just tick, and now it all works.

Thanks a lot 🙂

Best,
Peter 

Albert_Candelario

Excellent, that is what I wanted to confirm, if the setting was marked or not.

 

Thanks for sharing @peter_nbc 

Please, remember to mark the thread as solved once getting the correct answer