Forum Discussion

iBusinessBI's avatar
iBusinessBI
Kudo Collector
3 years ago
Solved

Get data from REST API source with iterated nested API calls (with Data Pipelines)

I have a working Dataflow that does the following: 1. Pulls a Customers list from an API call (https://api.somecrm.com/v1/customers). 2. For EACH Customer it calls another API to get his/hers purch...
  • Ayybee's avatar
    2 years ago
    1. First, you need to set up a WEB Activity that pulls the customer list by calling the API/customers.
    2. Once you have the customer list, you have to set up a ForEach Activity.
    3. In ForEach Activity, go to Settings -> Items -> Add Dynamic Content.   Array(activity([NAMEOFWEBACTIVITY]).output.data)
    4. Here, you need to access the data from JSON. ​
    5. Now, add a copy activity inside the ForEach Activity in order to save the JSON files into the lakehouse directly.
    6. To access the JSON objects via "customerId" go to the CopyActivity inside ForEach Activity.
    7. Source -> Add the connection here.
    8. In Realtive URL -> Add dynamic content  @concat('purchaselist/',item().customerId)​
    9. Set up the destination where you want to save the JSON objects as JSON files and run the pipeline.