
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to pass parameters dynamically in rest connector in Qlik sense
I have set a variable in qlik sense . i have to pass this variable as query parameters in get method.
I tried to pass this variable . but getting @value .Its not retrieving data from service. But when I pass hardcoded value ,
then getting result . Can anyone help me
- « Previous Replies
-
- 1
- 2
- Next Replies »
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For Dynamic Parameters Refer Thread REST connector with automatic date update
You can try:
Let vProductId = 2;
RestConnectorMasterTable:
SQL SELECT
"CategoryName",
"Name",
"Price",
"ProductId"
FROM JSON (wrap on) "root"
WITH CONNECTION (
QUERY "ProductId" "$(vProductId)")
;
[root]:
LOAD [CategoryName] AS [CategoryName],
[Name] AS [Name],
[Price] AS [Price],
[ProductId] AS [ProductId]
RESIDENT RestConnectorMasterTable;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Share you code

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is the generated code. I have used getmethod and passed productid = 1 in rest connector
LIB CONNECT TO 'Rest';
RestConnectorMasterTable:
SQL SELECT
"CategoryName",
"Name",
"Price",
"ProductId"
FROM JSON (wrap on) "root";
[root]:
LOAD [CategoryName] AS [CategoryName],
[Name] AS [Name],
[Price] AS [Price],
[ProductId] AS [ProductId]
RESIDENT RestConnectorMasterTable;
DROP TABLE RestConnectorMasterTable;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For Dynamic Parameters Refer Thread REST connector with automatic date update
You can try:
Let vProductId = 2;
RestConnectorMasterTable:
SQL SELECT
"CategoryName",
"Name",
"Price",
"ProductId"
FROM JSON (wrap on) "root"
WITH CONNECTION (
QUERY "ProductId" "$(vProductId)")
;
[root]:
LOAD [CategoryName] AS [CategoryName],
[Name] AS [Name],
[Price] AS [Price],
[ProductId] AS [ProductId]
RESIDENT RestConnectorMasterTable;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I had set query parameter value 1 bydefault in rest connector . I am getting productid 1 data. Its not filtering using vProductId = 2 . Its a get method . Will your query work on get method ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is my get method
[OperationContract]
[WebGet(ResponseFormat = WebMessageFormat.Json, UriTemplate = "/GetProductListByproductId/{*Id}")]
List<Product> GetProductListByproductId(string Id);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I haven't tried with Get Method.
But you can try some solutions from
http://help.qlik.com/en-US/connectors/Subsystems/REST_connector_help/Content/1.1/Load-REST-data/Sele...05106734-1799817335.1478168646
Try changing Url parameter.
Example is given in above link

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Now I have written one POST method.
[OperationContract]
[WebInvoke(Method = "POST",
BodyStyle = WebMessageBodyStyle.Bare,
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json,
UriTemplate = "GetCategoryList/")]
List<Product> GetCategoryList(test id);
What should I do in the request body space in the rest connector ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Does POST method works for Productid =1?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In post man application I tested POST method with parameter {"id":"1"}. Then Its working.
Here in rest connector there is a space for request body..what should i fill in that box.

- « Previous Replies
-
- 1
- 2
- Next Replies »