web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / GETting and storing JS...
Power Apps
Answered

GETting and storing JSON results over multiple REST API calls

(0) ShareShare
ReportReport
Posted on by 32

So I have a REST API (Jira in this case) and I'm retrieving quite a large number of records. The API only allows a maximum of 100 records to be retrieved at any one time.

 

The API does return the total amount of records on the first call. So let's say I had 284 records to retrieve and store in a Collection. At the moment I am doing it in a very hacky way like this and ending up with all records in a collection called jiraRawData, but there more be a more robust way to deal with any amount of records.

 

What's the best way to do this seeing as PowerApps doesn't have a proper loop construct ? Thanks.

ClearCollect(
 jiraRawData1,
 JIRACloudAPI.GetIssuesForJQLQuery(
 {
 jql: "project = MYPROJECT AND issuetype in (standardIssueTypes(), subTaskIssueTypes(), Bug, Epic, Feedback, Spike, Story, Task, Bug-Subtask, Sub-task) AND fixVersion in (10.14.0, 11.0.0, 11.1.0) ORDER BY created DESC",
 startAt: 0,
 maxResults: 100
 }
 ).issues
);
ClearCollect(
 jiraRawData2,
 jiraRawData1,
 JIRACloudAPI.GetIssuesForJQLQuery(
 {
 jql: "project = MYPROJECT AND issuetype in (standardIssueTypes(), subTaskIssueTypes(), Bug, Epic, Feedback, Spike, Story, Task, Bug-Subtask, Sub-task) AND fixVersion in (10.14.0, 11.0.0, 11.1.0) ORDER BY created DESC",
 startAt: 100,
 maxResults: 100
 }
 ).issues
);
ClearCollect(
 jiraRawData,
 jiraRawData2,
 JIRACloudAPI.GetIssuesForJQLQuery(
 {
 jql: "project = MYPROJECT AND issuetype in (standardIssueTypes(), subTaskIssueTypes(), Bug, Epic, Feedback, Spike, Story, Task, Bug-Subtask, Sub-task) AND fixVersion in (10.14.0, 11.0.0, 11.1.0) ORDER BY created DESC",
 startAt: 200,
 maxResults: 100
 }
 ).issues
);

 

Categories:
I have the same question (0)
  • Verified answer
    v-xiaochen-msft Profile Picture
    on at

    Hi @slong ,

     

    According to your description, I think the forall() function and the collect() function can meet your needs.

     

    I did a test for you.

     

    1\ I assume you have 284 records to retrieve.

    So you need to loop 3 times.

     

    2\ You could try the following formula:

    ClearCollect(Thevar,0); ForAll(Sequence(3),Collect(jiraRawData,

    ClearCollect(jiraRawData1,JIRACloudAPI.GetIssuesForJQLQuery({jql: "project = MYPROJECT AND issuetype in (standardIssueTypes(), subTaskIssueTypes(), Bug, Epic, Feedback, Spike, Story, Task, Bug-Subtask, Sub-task) AND fixVersion in (10.14.0, 11.0.0, 11.1.0) ORDER BY created DESC",startAt: Last(Thevar).Value,maxResults: 100}).issues)) ; Collect(Thevar,Last(Thevar).Value+100)

    )

     

    Best Regards,

    Wearsky

    If my post helps, then please consider Accept it as the solution to help others. Thanks.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard