Tag Replacement
Use our API to replace text, images, tables, and charts.
View the Video Explanation
There are 2 simple steps:
Configure your document with placeholders
Use the API to generate your document
Configure Your FlashDocs Document
Tag replacement works best with template documents because, before you make the deck generation request, you will already have knowledge of which placeholders will be in the deck. You can then specify the values for the placeholders via the text_placeholder_manual_insertions
parameter.
If you want to make dynamically sized decks, you can use a library source document, and specify the slide ids in the outline parameter. If you store the text placeholders and the index of the slide for each slide id, you can similarly specify the values for the placeholders via the text_placeholder_manual_insertions
parameter.
This page describes how to configure a document:
Configure FlashDocs Document
Use FlashDocs’s dashboard to configure your template/library.
Generate Your Deck via the API
You have 3 options when generating a deck. A. Manually specify the values for all placeholders. B. Manually specify the values for some placeholders and have FlashDocs generate the values for the rest. C. Have FlashDocs generate the values for the placeholders based on the prompt.
Manually specify values for placeholders
In the generate deck request (Generate Slides Synchronous or Generate Slides Asynchronous), you can use the text_placeholder_manual_insertions
parameter to map a text placeholder to its value.
This parameter supports markdown! This means that you can insert bullet points, section headers, etc. for a placeholder and we render it natively in Google Slides & PowerPoint.
Identifying Placeholders
To find all of the text placeholders in your deck:
Use this endpoint with include_slides=true
: Get Document Full Data. For each slide in document.slides
, you can find a list of the text placeholders: document.slides[i].text_placeholders
. For each placeholder, you will find the placeholder
attribute: document.slides[i].text_placeholders[j].placeholder
which is the placeholder of text on the slide.
Configuring and specifying values for placeholders can get a bit complicated. Contact adam@flashdocs.ai if you have any questions.
Structuring the text_placeholder_manual_insertions
parameter
The parameter is a list of commands specifying the text placeholder and the value you would like for it to have.
Example:
Note that each instruction must contain the placeholder
and value
keys. Some placeholders may exist in multiple places throughout the deck. If you want the placeholder to only be set on a single slide (instead of the whole deck) for a particular value, use the index
key.
The value for an item in text_placeholder_manual_insertions
can support rich text formatting via MarkDown. (See the last item in the example).
Have FlashDocs generate values for the placeholders
By default, if any text/image/chart placeholder is not manually specified via the text_placeholder_manual_insertions
parameter, FlashDocs generates the values.
For each text placeholder:
-
FlashDocs uses the
prompt
parameter in the API request, values for any other placeholders, and the following data from the slide and text placeholder object:-
Slide description
-
Text placeholder instruction
-
Text placeholder minimim characters
-
Text placeholder maximum characters
-
You can create, view, and edit your organization’s FlashDocs templates & libraries at: https://dash.flashdocs.ai