# List of dictionary in CSV file

**URL:** <https://forum.robotframework.org/t/list-of-dictionary-in-csv-file/929>\
**Category:** DataDriver\
**Created:** [5 November 2020 08:59 UTC](https://forum.robotframework.org/t/list-of-dictionary-in-csv-file/929 "2020-11-05T08:59:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Typhon](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@Typhon](https://forum.robotframework.org/u/Typhon)\
**Post date:** [5 November 2020 08:59 UTC](https://forum.robotframework.org/t/list-of-dictionary-in-csv-file/929/1 "2020-11-05T08:59:32Z")

</div>

Hi,

I use DataDriver to set a CSV file with different types of parameter and it works fine.  
My need is to set a list of dictionary in one parameter in order to iterate it in a Keyword.

CSV file :  
e{attributes}  
[{“name”=“John”,“age”=“33”},{“name”=“Alice”,“age”=“40”}]

Error message :  
[ERROR] Calling method ‘\_start\_suite’ of listener ‘DataDriver’ failed: SyntaxError: invalid syntax (, line 1)  
Variable ‘${attributes}’ not found.

If the CSV file has got a list with non dictionary value, the test execution is OK.

Do you have any clue to set a list of dictionary in CSV file ?

Thanks a lot for your ideas.

---

<div class="post-metadata">

**Author:** ![René](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/ren%C3%A9/32/7_2.png) [@René](https://forum.robotframework.org/u/Ren%C3%A9)\
**Post date:** [5 November 2020 09:26 UTC](https://forum.robotframework.org/t/list-of-dictionary-in-csv-file/929/2 "2020-11-05T09:26:46Z")

</div>

> [@Typhon](#):
>
> [{“name”=“John”,“age”=“33”},{“name”=“Alice”,“age”=“40”}]

That is not correct python syntax.

Dictionaries are created like that:

```python
my_dictionary = {"name":"John", "age":"33"}

```

So your List shall be like this:

```python
[{"name": "John", "age": "33"}, {"name": "Alice", "age": "40"}]

```

and you should also take care of that “double”-Quotes.  
Sometimes in Excel you do not get `"`but you get `“` or `”`. That is something different…

---

<div class="post-metadata">

**Author:** ![Typhon](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@Typhon](https://forum.robotframework.org/u/Typhon)\
**Post date:** [5 November 2020 10:02 UTC](https://forum.robotframework.org/t/list-of-dictionary-in-csv-file/929/3 "2020-11-05T10:02:28Z")

</div>

My bad, I feel guilty for = and : 🙁

For double quote, the CSV file is edited with Vi.

Thank you René for your outside look.
