Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jonvitale
Creator III
Creator III

Variable Field Names in On-Demand App Generation (ODAG)

Hi all,

This question regards ODAG, but may simply be a problem with my dollar-sign expansions.

I want to be able to create an ODAG application with field names that are pulled in from an external table. This means that I don't want to hardcode field names in the data load editor.

The sample ODAG application "Flight Data", has a few fields that are being used for selections, including "Origin Code". Here is a snippet of code in the "Flight Data Detail" app that shows how the odag variable is used to access the field selections.

SET ORIGIN = ;

SET ORIGIN = $(odso_Origin Code);

SET ORIGIN_COLNAME='ORIGIN';

Trace ORIGIN: $(ORIGIN);

The Trace for this code looks like this (with a single selection on the Origin Code field):

ORIGIN: chr(39) & 'ABI' & chr(39)

What I'd like to do is use a variable field name, which I could set based upon a table, instead of hard-coding $(odso_Origin Code).

So I imagine something like this.

Let fieldName = 'Origin Code';

Set ODSO = odso_$(fieldName);

Let ODSO2 = '$(ODSO)';

SET ORIGIN2 = ;

SET ORIGIN2 = $($(ODSO2));

SET ORIGIN2_COLNAME='ORIGIN2';

Trace ORIGIN2: $(ORIGIN2);

This isn't working and I've tried, many different variations of Sets and Lets, Dollar-sign expansions, string expressions that are later evaluated, etc.

I'm not sure if the issue Qlik-General or ODAG specific.

Thanks.

1 Solution

Accepted Solutions
treysmithdev
Partner Ambassador
Partner Ambassador

Hey Jonathan,

Unfortunately, this is not possible. When an On Demand app is created it first replaces the $(odso_FIELD) before running the app; it is hard coded in the script. By generating the variable with the above code, the Template app won't see any bindings, and therefore not replace the Binding variable, with the appropriate values.

Blog: WhereClause   Twitter: @treysmithdev

View solution in original post

5 Replies
treysmithdev
Partner Ambassador
Partner Ambassador

Hey Jonathan,

Unfortunately, this is not possible. When an On Demand app is created it first replaces the $(odso_FIELD) before running the app; it is hard coded in the script. By generating the variable with the above code, the Template app won't see any bindings, and therefore not replace the Binding variable, with the appropriate values.

Blog: WhereClause   Twitter: @treysmithdev
jonvitale
Creator III
Creator III
Author

Yeah, I pretty much figured, but this is unfortunate.

mary_papadopoulou
Partner - Contributor II
Partner - Contributor II

Is there still the above limitation?

PabloLabbeImaps
Partner Ambassador
Partner Ambassador

It´s not a limitation. It´s by design.

mary_papadopoulou
Partner - Contributor II
Partner - Contributor II

Thank you for your quick response!

So the only way to bind the template app is through a field, and I can't somehow replace the binding variable, right?

In my case, I don't use ODAG but Dynamic Views. I understand that the design is the same.