Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Pagination with REST API - Logiforms

Hi,

 

Thanks for reading in advance.

 

I am able to connect to the REST API but I am unable to select pages other than the current page. I am using a get pages function to list total number of pages but this just pulls the current page and mutliplies it by the total number of pages. This is the API I am using and this is how the pagination works but I do not know how to apply it in Power BI.  Logiforms API Version 1.0 Documentation

 

 

Here's screen shots of the API query  steps and the codes are below. 

 

1. AMAJ123_1-1621255947469.png

 

2. AMAJ123_2-1621255988716.png

 

3. AMAJ123_3-1621256001984.png

 

4. AMAJ123_4-1621256030438.png

 

5. AMAJ123_13-1621256178769.png

 

 

6. AMAJ123_18-1621256249080.png

 

 

This is the code I am using for the API. I've omitted some sensitive information: 

Source = Json.Document(Web.Contents("https://forms.logiforms.com/api/1.0/form/xxxxx/data/")),
data = Source[data],
List={1..data[total_pages]},
#"Converted to Table" = Table.FromList(List, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Column1", type text}}),
#"Invoked Custom Function" = Table.AddColumn(#"Changed Type", "getPage", each getPages([Column1])),
#"Expanded getPage" = Table.ExpandTableColumn(#"Invoked Custom Function", "getPage", {"Col 2", "Col3", "Col 4", "Col 5"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Expanded getPage",{{"Line Manager Email", type text}, {"Line Manager", type text}, {"Programme / Dept", type text}, {"Quarterly score", type text}, {"CoMember Email", type text}, {"lfuuid", type text}, {"Job Title", type text}, {"Belinda email", type text}, {"Region", type text}, {"PAR Upload", type text}, {"CoMember Name", type text}, {"Senor Managers Email", type text}, {"Payroll Number", type text}, {"Senior Manager", type text}, {"datesubmitted", type datetime}, {"RecordID", type date}})
in
#"Expanded getPage"

 

 

 

This is the getPage function I am using to list all the pages:

 

(page as text) =>

let
Source = Json.Document(Web.Contents("https://forms.logiforms.com/api/1.0/form/xxxxx/data/")),
data = Source[data],
records = data[records],
#"Converted to Table" = Table.FromList(records, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"Col 1", "Col 2", "Col 3", "Col 4", "Col 5"}, {"Col 1", "Col 2", "Col 3", "Col 4", "Col 5"})
in
#"Expanded Column1"

 

 

 

 

2 REPLIES 2
v-robertq-msft
Community Support
Community Support

Hi, @Anonymous 

Glad to hear that you have solved your problem by yourself, would you like to share some experience or just mark your own reply as a solution so that others can learn from it too?

Thanks in advance!

How to Get Your Question Answered Quickly 

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

I figured it out

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.