Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I'm currently working on a project that involves interacting with the Zendesk API, and I've run into a bit of an issue. I need to retrieve specific fields from a range of tickets. My code looks like this:
My expectation was to obtain, for each ticket number, two fields (calendar, business). However, I'm encountering an issue where I'm getting all the combinations for each ticket, which seems like a concatenate table:
ticket_id calendar business
1 46665 46665
2 46665 46665
1 74941 74941
2 74941 74941
Can someone help me understand what might be going wrong here? Any advice or insights would be greatly appreciated. Thank you in advance for your assistance.
Hello @HeshamKhja1
Many thanks for replying my post. The code is generated by the connector.
Here the first part of the script:
Hi @Jorge_FR ,
If you load the first part of the code which is in the loop, do you get the expected result? or it is also incorrect?
Because when I look at the SQL query calling the API it seems like it is doing a join in the SQL. Is this the script Qlik generated? or you wrote it yourself?
Hello @HeshamKhja1
Many thanks for replying my post. The code is generated by the connector.
Here the first part of the script:
Hello,
I have resolved this issue by setting up the cursor pagination mode. Here's an example of the beginning of the loop :
For startAt = 0 to $(vTotal) step $(vPageSize)
// l'URL avec la pagination
Let vURL = 'https://company.zendesk.com/api/v2/tickets.json?page[size]=' & $(vPageSize);
trace $(vURL);
If vAfterCursor <> '' then
Let vURL = '$(vURL)&page[after]=$(vAfterCursor)';
trace vURL = $(vURL);
EndIf