Basic Jinja Syntax and Filters
Identify common Jinja syntax and filters + Use the Live Editor to practice Jinja code on data from the context
Module Overview
💡 It's time to tackle basic Jinja syntax and filters. These building blocks will help you write and practice Jinja code in the Jinja Live Editor, and eventually use it in your Rewst workflows.
Video (5:21 Minutes)
Key Concepts About Jinja Syntax
Action Items
Review Context Data from the "Building a Basic Form and Workflow" Lesson
Open the workflow results from your "Add or Remove User - Microsoft Group" workflow and review the context data. Practice rendering the following Jinja code in the Jinja Live Editor, and notice that the results match the values of the context data for the variables:
{{ CTX.action }}
{{ CTX.user_id }}
{{ CTX.group_id }}
Complete the Lunch Menu Exercises:
Navigate to the "Lesson Resources" section to access the "Lunch Menu" sample data set and instructions for using Jinja syntax and filters in the Jinja Live Editor. Focus on:
Rendering values from the context
Applying Jinja filters to format the output
Practicing list comprehension (using two different methods -- a Jinja statement, and list comprehension).
By practicing these exercises, you’ll solidify your understanding of Jinja syntax, filters, and data manipulation in Rewst workflows.
Navigation
Go to the previous module:
Go to the next module:
Last updated
Comments:
Use
{# #}
to add comments in your code. Comments are ignored during execution but help others (or yourself) understand the code.Example:
{# This is a comment #}