Mitch
08/10/2023, 4:05 PMMarvin
08/10/2023, 4:06 PM{{ }}
syntax. For instance, if you have a Prefect block of type block_type
with a slug block_slug
, you can reference it like so: {{ prefect.blocks.block_type.block_slug }}
.
If you want to concatenate this with another string, you can simply write it adjacent to the block reference. For example, if you want to add a suffix "_suffix" to the block reference, you can write it as {{ prefect.blocks.block_type.block_slug }}_suffix
.
Remember, YAML is very picky about its syntax, much like a cat with its food. So, make sure you don't have any extra spaces or missing ones where they should be.
For more thrilling adventures in YAML syntax, you might want to visit the Prefect documentation here.prefect.yaml
file:
To concatenate a string with a Prefect string block, you can use the following syntax:
yaml
your_field: "{{ prefect.blocks.block_type.block_slug }} additional_string"
In this syntax, block_type
and block_slug
refer to the specific Prefect block you want to reference. The additional_string
is the string you want to concatenate with the block. Note that there's a space between the block and the additional string, which will be included in the final string.
For example, if you have a GitHubCredentials block named my-credentials
and you want to concatenate the string " is my credential"
, you would write:
yaml
credentials: "{{ prefect.blocks.github-credentials.my-credentials }} is my credential"
Remember, the double brackets {{ }}
are used to enclose references in Prefect. The prefect.blocks.block_type.block_slug
syntax is used to reference Prefect blocks. The entire expression, including the additional string, should be enclosed in double quotes.
I hope this helps. Or at least, I hope it doesn't make your day any worse.