Sheet-to-Doc Placeholder System Detailed Explanation: Automatically Fill Data into Specific Positions in Word
In Sheet-to-Doc, placeholders are the bridge connecting Excel data and Word templates. By using different types of placeholders, we can automatically fill data into specific positions in Word templates and create personalized documents. Today, I will detailedly introduce Sheet-to-Doc’s placeholder system to help you master the skills of using various placeholders.
Placeholders are positions marked with special syntax in Word templates, and the Sheet-to-Doc tool will replace these positions with corresponding values from Excel data. The basic format of placeholders is {placeholder name}, and the tool will process them differently based on the type and name of the placeholders.
1. Data Placeholders: The Most Basic Placeholder Type
Data placeholders are the most commonly used placeholder type, used to fill a single data value from Excel into a Word template.
Syntax
1
{column name}
Usage Method
Define column names in Excel table, such as “Name”, “Age”, “Email”, etc.
Add placeholders in Word template using the format {column name}
The tool will automatically replace the placeholders with corresponding column values from Excel
2. Image Placeholders: Insert Dynamic Images in Word
Image placeholders are used to dynamically insert images into Word documents. Using image placeholders, you can insert different images into generated documents based on image names in Excel data.
Syntax
1 2
{@image column name | _inline_image:width:height} {@image column name | _block_image:width:height}
Usage Instructions
@image column name: Image placeholders must start with @, image column name is the column name in Excel that stores image names
_inline_image: Inline image, closely integrated with text
_block_image: Block-level image, independent of paragraphs
width and height: Optional parameters, specify image width and height (in centimeters)
Usage Method
Add a column in Excel table to store image names
Add image placeholders in Word template using the format {@image column name | _inline_image} or {@image column name | _block_image}
Upload image files to the Sheet-to-Doc tool
The tool will insert the corresponding images into the document based on image names in Excel data
Product Name: Watch Product Image: [watch.png image] (Note: This is an image, not displayed in this blog article)
Thank you for your attention!
3. Loop Placeholders: Handle Repeated Data
Loop placeholders are used to handle multiple rows of data in Excel and realize repeated content generation. Sheet-to-Doc supports two types of loop placeholders.
5. Conditional Placeholders: Display Content Based on Conditions
Conditional placeholders are used to display different content based on values in Excel data. Sheet-to-Doc supports three types of conditional placeholders.
{#data} {Name} is {Age} years old. {#Age >= 30} {Name} is 30 years old or above. {/} {/data}
Generated Document
1 2 3
Zhang San is 25 years old. Li Si is 35 years old. Li Si is 30 years old or above.
Best Practices for Using Placeholders
1. Keep Placeholder Names Consistent with Excel Column Names
Ensure that placeholder names in Word templates are completely consistent with column names in Excel tables, including case and spaces.
2. Use Clear Column Names
Choose concise and clear column names, avoiding overly complex or confusing names.
3. Test Placeholders
Before generating a large number of documents, test with a small amount of data to ensure that placeholders can be correctly replaced with corresponding data.
4. Utilize Data Comparison Function
Sheet-to-Doc provides a data comparison function that can help you find incorrect placeholders in templates. It is recommended to perform data comparison before generating documents each time.
5. Use Placeholders Nested
You can nest different types of placeholders, such as using data placeholders and conditional placeholders within loop placeholders, to create more complex document structures.
Summary
Sheet-to-Doc’s placeholder system is very powerful, supporting multiple types of placeholders, including data placeholders, image placeholders, loop placeholders, and conditional placeholders. By flexibly using these placeholders, you can create various complex document templates and realize automatic conversion from Excel to Word.
In the following series of articles, we will delve into advanced features of Sheet-to-Doc, including usage skills of loop placeholders, image processing, data format support, etc. Stay tuned!