COLOR_CELL #
Imagine you have a table of opportunity products that includes fields like Name, Quantity, and Total Price. For guidance on how to generate this table, refer to the instructions provided here.
Now, let’s apply conditional coloring to the Total Price cell based on the following criteria:
- Total Price is < 10000 => Red
- 10,000 ≤ Total Price < 100,000 => Orange
- Total Price is >= 100000 => Green
Steps to generate document:
- Create Data Source to fetch opportunity products with required fields.
- Create Main word document Doc Config and upload the template with merge fields. In the template you can place the merge field in the cell for which you want to apply the color.
- Add Data source to the Doc Config and create COLOR_CELL Config types for the color merge field from the template as shown below. For the table refer the documentation here. Based on Total price conditions mentioned above, add the criteria for each COLOR_CELL Config type.
- Open an opportunity, edit the page to add PDF Butler Convert component and the above create Doc Config Id.
- Download or preview the document to see the applied cell colors. Each cell will be colored based on the criteria defined for its corresponding COLOR_CELL configuration type as shown in the screenshot below.
COLOR_ROW #
You can easily apply color to the row in your table using the COLOR_ROW configuration type. Just follow the steps below to get started.
Example: #
Imagine you have a table of opportunity products that includes fields like Name, Quantity, and Total Price. For guidance on how to generate this table, refer to the instructions provided here.
Now, let’s apply conditional coloring to the Total Price cell based on the following criteria:
- Total Price is < 10000 => Red
- 10,000 ≤ Total Price < 100,000 => Orange
- Total Price is >= 100000 => Green
Steps to generate document:
- To the same Doc Config mentioned above, instead of adding color to the cell, create COLOR_ROW config types for the same merge field as shown below and add above criteria for each config type. You can place the merge field in any cell, as the color applies to the entire row. However, make sure to choose the correct field while adding criteria to the configtypes.
- Download or preview the document to see the applied cell colors. Each row will be colored based on the criteria defined for its corresponding COLOR_ROW configuration type as shown in the screenshot below.