I have the following dictionary of dictionaries:
{
"col_labels": [
"Naam",
"Discipline",
"Rol",
"Bedrijf"
],
"project_disciplines_final": [
{
"dict_1": [
"Marcel",
"discipline_eof",
"projectfunctie_1",
"discipline_instantie_2"
]
},
{
"dict_2": [
"Hamed",
"discipline_eof",
"projectfunctie_2",
"discipline_instantie_2"
]
},
{
"dict_3": [
"Robin",
"discipline_eof",
"projectfunctie_6",
"discipline_instantie_1"
]
},
{
"dict_4": [
"Gerritsen",
"discipline_eof",
"projectfunctie_2",
"discipline_instantie_1"
]
}
]
}
I would like to create a Word table using the docxtpl
and jinja2
Python packages, but I cannot figure out the syntax to use in the Word file.
I have the following:
And I want this table in my Word file:
It is important that the table is dynamic because the number of rows varies and is dependent on the length of the provided dictionary 'project_discplines_final'.
Does anyone know what is wrong with my syntax in Word (first image)? Many thanks in advance!