Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Support,
I have 2 questions:
1. How to dynamically pass the restful query parameters?
for example: I have a restful API that get me a 64 base image. My restful call takes 2 parameters: ID and Date.
I created a restful connection inside Qlik sense and I hardcoded my 2 query parameters ID and Date.
I get successfully the image. However, I want to be able to pass those parameters dynamically so I can different
image for different ID and date.
2. I have created a Qlik sense extension. In my extension, I have a folder images/.
The output of my extension is html element constructed in the paint method.
I want to be able to display images inside my html element that are coming from images/ folder.
Example: My extension name is DisplayOrderSection and inside DisplayOrderSection, i have images folder that has images:
DisplayOrderSection/images/order1.jpg
In my html, I have an html image tag,
var imagePath = "Extensions/DisplayOrderSection /images/";
var order1Image = '<img src=' + imagePath + 'order1.jpg>';
$element.append(order1Image);
return qlik.Promise.resolve();
the image is not displayed in item 2.
Please let me know.
Thank you.
Any update regarding this issue?
1.
Turn ON legacy mode in Qlik, there is a direct option to do that on server but for Desktop modify the setting.ini file in Documents/Qlik/Sense and paste below code
[Settings 7]
StandardReload=0
OverrideScriptSecurity=1
Open qlik view and generate a script for loading data from Rest web service, you might need to install rest connector first.
Then copy the script, paste it into Qlik Sense, identify your arguments in autogenerated script, replace it with a variable.
Create a loop outside the autogenerated script, modify value of variable through every iteration.
Note: Do not modify rest master table script other than your arguments.
2. Don't know much about HTML or Javascript.
I have Qlik Sense version:
I don't have Qlik view.
Please let me know what you meant by open Qlik view and generate the script
Thank you.
Hello Shubham,
Please tell me what portion of the script that I should take and put it in the extension.
Do you have an example of an extension that calls REST with Dynamic parameters?
______________________________________________
LIB CONNECT TO 'GetBNSImage';
[records]:
LOAD "cycle_date" as "cycle_date",
"back_image" as "back_image",
"isn" as "isn",
"front_image" as "front_image";
SQL SELECT
"cycle_date",
"back_image",
"isn",
"front_image"
FROM JSON (wrap off) "records";
[records_temp_3151abf7-90f5-c3b7-cd96-4f0d2f19]:
LOAD
'-' AS [Extra_0871c84d-48ee-d40e-594b-b1381fc2],
Date(Date#([cycle_date], 'YYYYMMDD') ) AS [cycle_date],
[back_image],
[isn],
[front_image]
RESIDENT [records];
DROP TABLE [records];
DROP FIELD [Extra_0871c84d-48ee-d40e-594b-b1381fc2];
RENAME TABLE [records_temp_3151abf7-90f5-c3b7-cd96-4f0d2f19] TO [records];
[autoCalendar]:
DECLARE FIELD DEFINITION Tagged ('$date')
FIELDS
Dual(Year($1), YearStart($1)) AS [Year] Tagged ('$axis', '$year'),
Dual('Q'&Num(Ceil(Num(Month($1))/3)),Num(Ceil(NUM(Month($1))/3),00)) AS [Quarter] Tagged ('$quarter', '$cyclic'),
Dual(Year($1)&'-Q'&Num(Ceil(Num(Month($1))/3)),QuarterStart($1)) AS [YearQuarter] Tagged ('$yearquarter', '$qualified'),
Dual('Q'&Num(Ceil(Num(Month($1))/3)),QuarterStart($1)) AS [_YearQuarter] Tagged ('$yearquarter', '$hidden', '$simplified'),
Month($1) AS [Month] Tagged ('$month', '$cyclic'),
Dual(Year($1)&'-'&Month($1), monthstart($1)) AS [YearMonth] Tagged ('$axis', '$yearmonth', '$qualified'),
Dual(Month($1), monthstart($1)) AS [_YearMonth] Tagged ('$axis', '$yearmonth', '$simplified', '$hidden'),
Dual('W'&Num(Week($1),00), Num(Week($1),00)) AS [Week] Tagged ('$weeknumber', '$cyclic'),
Date(Floor($1)) AS [Date] Tagged ('$axis', '$date', '$qualified'),
Date(Floor($1), 'D') AS [_Date] Tagged ('$axis', '$date', '$hidden', '$simplified');
DERIVE FIELDS FROM FIELDS [cycle_date] USING [autoCalendar] ;