Importing many Surveys in Power Query

TamirBasin

New Member
Joined
Apr 11, 2017
Messages
49
Office Version
  1. 365
Platform
  1. Windows
Hi,
I would like to import multiple surveys from a SaaS company into Excel.

I managed to create a flow that will import 1 survet at a time with all its pages (there is a pagination every 50 records).

Created a parameter called SurveyNumber:
Power Query:
"90365258" meta [IsParameterQuery=true, List={"90365285", "90365336", "90365258"}, DefaultValue="90365285", Type="Text", IsParameterQueryRequired=true]

Created a function called fxGetAllPages to handle the pagination and the parameter for the Survey
Power Query:
(PageStart as text)=>
let
    Source = Json.Document(Web.Contents("https://api.alchemer.eu/v4/survey/"&SurveyNumber&"/surveyresponse?&api_token=9999999999999999999999999999999999&api_token_secret=99999999999999999999999999="&PageStart&""))
in
    Source

When I select the survey number from the list I get the data in a table.

The question:
How can I loop through the list of surveys to union the data from all of them into one query?

Thank you,
Tamir
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Wild guess here, since this is something I never need to do in Power Query. Maybe this works:
Power Query:
List.Transform({SurveyNumbers}, each fxGetAllPages( _ ))

EDIT: Maybe you need to pass the parameter for SurveyNumber as well in the function. Something like
Power Query:
List.Transform({SurveyNumbers}, each fxGetAllPages(PageStart, _ ))
 
Upvote 0

Forum statistics

Threads
1,225,562
Messages
6,185,672
Members
453,314
Latest member
amitojsd

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top