# Hi, 

I'm using Python to access the API for Anaplan - this provides a csv output. I've seen some other posts about how to add the results to a grid query but I am getting an error I'm unable to progress

**URL:** <https://matillioncommunity.discourse.group/t/hi-im-using-python-to-access-the-api-for-anaplan-this-provides-a-csv-output-ive-seen-some-other-posts-about-how-to-add-the-results-to-a-grid-query-but-i-am-getting-an-error-im-unable-to-progress/1304>\
**Category:** Matillion ETL\
**Created:** [March 10, 2021, 8:11am UTC](https://matillioncommunity.discourse.group/t/hi-im-using-python-to-access-the-api-for-anaplan-this-provides-a-csv-output-ive-seen-some-other-posts-about-how-to-add-the-results-to-a-grid-query-but-i-am-getting-an-error-im-unable-to-progress/1304 "2021-03-10T08:11:32Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Bryan](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@Bryan](https://matillioncommunity.discourse.group/u/Bryan)\
**Post date:** [March 10, 2021, 6:26pm UTC](https://matillioncommunity.discourse.group/t/hi-im-using-python-to-access-the-api-for-anaplan-this-provides-a-csv-output-ive-seen-some-other-posts-about-how-to-add-the-results-to-a-grid-query-but-i-am-getting-an-error-im-unable-to-progress/1304/4 "2021-03-10T18:26:44Z")

</div>

Hi [@joshua.stockwell](https://matillioncommunity.discourse.group/u/joshua.stockwell)​ ,

As [@ELTuser77](https://matillioncommunity.discourse.group/u/ELTuser77)​ mentioned you need to wrap the list results with square brackets. Effectively, wrapping the square brackets around the results is creating an array of rows of values that match up to the columns in your grid variable. The important thing to note here is that order matters. Meaning if the order of your column values need be in the same order that exists in your grid variable columns. [@MichaelBoucht](https://matillioncommunity.discourse.group/u/MichaelBoucht)​ posted a very simplified answer to how this is done a while back which I thought was very simple and easy to understand example of how to do this. You can check that out here: [https://matillioncommunity.discourse.group/t/grid-variable-updating-in-python-script/1200](https://matillioncommunity.discourse.group/t/grid-variable-updating-in-python-script/1200)

I hope this helps.

---

_[View the full topic](https://matillioncommunity.discourse.group/t/hi-im-using-python-to-access-the-api-for-anaplan-this-provides-a-csv-output-ive-seen-some-other-posts-about-how-to-add-the-results-to-a-grid-query-but-i-am-getting-an-error-im-unable-to-progress/1304)._
