Let’s say you run a course or workshop. You need to create e-certificates for participation.
It will be be tedious to generate these manually for each participants – especially if the volume is large.
Let’s automate this, and create certificates like this:
Start by creating a template.pptx that has the static content laid out. This is from PowerPoint’s online templates Ribbon certificate of completion.
It has 3 shapes that will be updated from data:
Name
: name of the person who receives the certificate, e.g. James SmithCourse
: name of the course they completed, e.g. Introduction to PythonDate
: date on which , e.g. 4 Oct 2020The data has 3 columns that correspond to the shape names on the template:
Name
: name of the person who receives the certificate, e.g. James SmithCourse
: name of the course they completed, e.g. Introduction to PythonDate
: date on which , e.g. 4 Oct 2020Let’s set up a basic gramex.yaml
file that loads the template and the data.
version: 2
source: $YAMLPATH/template.pptx
data:
url: $YAMLPATH/people.csv
Now, we’ll set up a rule that copies the slide for each row of the data.
rules:
- copy-slide: data
This copies the slide for each year. The variable copy.val
has the data for each row.
Next, let’s set the name of the person on each slide:
Name:
text: copy.val.Name
Let’s do the same thing for Date and Course.
Course:
text: copy.val.Course
Date:
text: copy.val.Date
That’s all it takes to update every field.