Only getting a single record from Rest API to csv file.

Hmong Lee 0 Reputation points
2024-02-20T18:42:36.3633333+00:00

Hi, I keep getting a single record from pulling data from Rest API to a csv file. I have also selected/checked the Collection reference and get the same result of a single record. Any suggestion on solution is appreciated.

User's image

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,624 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Smaran Thoomu 24,110 Reputation points Microsoft External Staff Moderator
    2024-02-21T10:32:00.6433333+00:00

    Hi @Hmong Lee

    Thank you for reaching out to the community forum with your query. Based on the information you provided, it seems like you are only getting a single record from pulling data from a Rest API to a CSV file.

    To resolve this issue, I would suggest checking the following:

    1. Verify that the Rest API endpoint is returning the expected data. You can do this by testing the endpoint using a tool like Postman or cURL.
    2. Ensure the API endpoint you're using supports pagination (if the data is expected to be more than one record). If it does, verify that the pagination settings are configured correctly in your ADF mapping.
    3. Check that the CSV file is being created correctly and that it is not being overwritten with each new record. You can do this by opening the CSV file in a text editor or spreadsheet application.
    4. Review the code that is pulling data from the Rest API to ensure that it is correctly handling the response and appending new records to the CSV file. You can share the code snippet with us if you need further assistance.

    If the issue persists, please provide more details about the Rest API and CSV file creation process, including any relevant code snippets, to help identify the root cause of the issue. Additionally, I came across a third-party article that provides a step-by-step process to read multiple pages of an API and export the data to different CSV files. However, it may be relevant to your query, and you can use it as a reference to help you resolve the issue.

    I hope this helps! Let me know if you have any further questions or concerns.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.