Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
romansysyuk
Contributor II
Contributor II

[QRS API] to cut a result

Hi,

I'm trying to load data using QRS API. Everything goes fine, except "user/full". There are too many rows there. So I decided to cut the result.

Here is a JSON structure: https://help.qlik.com/en-US/sense-developer/February2019/APIs/repositoryserviceapi/index.html?page=1...

{"userId":"some_userId_value","attributes":{"attributeValue":"some_attributeValue_value"}}

Filtering by "userId" field works fine: https://localhost/qrs/user/full?filter=userId eq 'some_userId_value'

But I can't use same filtering logic with "attributeValue" field: https://localhost/qrs/user/full?filter=attributeValue eq 'some_attributeValue_value' gives error "Cannot convert the constant value: attributeValue".

As I can suggest, this is because "attributeValue" is a subfield (a part of "attributes" array).

But I don't know how to write field names in such a case and if it is possible at all.

Tried to hardcode "...filter=attribute/attributeValue eq..." and so on, but didn't help.

1) So the first question is what filter construction would be correct in case we need to filter by an attribute, which is not in root table?

 

As a workaround, I see Offset Pagination. But I have no idea, what should be 'Start','Record','Total' REST connector parameters in the QRS API. 'Start','Record' could be 'offset','limit', but I'm not sure. And what should be Total... And I found it a bit difficult to find any information about it.

2) And next question is what parameters to fill in REST connector pagination?

Labels (2)
1 Solution

Accepted Solutions
evanplancaster
Contributor III
Contributor III

Might be a little late to the party here, but hopefully it will help someone in the future.

You mention the JSON structure is this: 

{
"userId": "some_userId_value",
"attributes":{
"attributeValue": "some_attributeValue_value"
}
}

So to get to the attribute's value (which you call "some_attributeValue_value" in this example), you need to use the following filter:

filter=attributes.attributeValue eq 'some_attributeValue_value'

This navigates the nested properties of the JSON object properly.

Hope that helps someone!

View solution in original post

2 Replies
micheledenardi
Specialist II
Specialist II

Did you find a solution about paginating QRS API?

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
evanplancaster
Contributor III
Contributor III

Might be a little late to the party here, but hopefully it will help someone in the future.

You mention the JSON structure is this: 

{
"userId": "some_userId_value",
"attributes":{
"attributeValue": "some_attributeValue_value"
}
}

So to get to the attribute's value (which you call "some_attributeValue_value" in this example), you need to use the following filter:

filter=attributes.attributeValue eq 'some_attributeValue_value'

This navigates the nested properties of the JSON object properly.

Hope that helps someone!