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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Spartan27215
Partner - Creator
Partner - Creator

Publishing App with different data source

I am confused on how to connect to a different data source when an application is published. How is this accomplished without having to manually edit the data connections in each of the different spaces?

Labels (1)
  • SaaS

3 Replies
rubenmarin
MVP
MVP

Hi, probably there is a better way but you can use the app name to connect to a different sources, so if the app name starts with 'DEV_' it uses dev connection, the code may be something like:

LET vDocumentTitle = DocumentTitle();
IF Upper(Left(vDocumentTitle,4))='DEV_' then
  SET vConnection = 'DEVConnection';
Else
  SET vConnection = 'PROConnection';
End If

LIB Connect to '$(vConnection)';

 

Spartan27215
Partner - Creator
Partner - Creator
Author

Ok I see that. i did not know the syntax to use. I guess this means that I have to have all of my data sources "Predefined" and in the same space. I do not see in the SaaS version a way of creating SQL connectors on the fly and OLEDB Connect To only seems to apply to an on-prem version.

rubenmarin
MVP
MVP

Hi, yes, for SQL connectors you have the data connections predefined and the script choose wich one to use based on the app name.