How to create dynamic text with Markup Functions. From Tips & Tricks - Vol 2/21
Sneak: Dynamic Text with Markup Functions
The Tips&Tricks Series is produced by the Customer Success Team. It highlights several easy to follow instructions and range from simple tasks to more advanced use cases.
How to create dynamic Text with Markup functions
In this scenario we’re going to show how to mark-up dynamically created dynamic text in a Publication document.
- Add a Text field and from the Component ribbon select Dynamic Text
- In the Content panel, find and select the grid you want to base your dynamic text on. You must select a grid, as dynamic text is supported for grids only.
- We are going to add a dynamic text to inform what’s the top seller product, adding the sales amount. The markup functions will be used in the formula to change the font color and size for the product name; underline the sales amounts and add a line break.
- In the formula panel select the Top N Product report, this is the one to be used to compose the formula.
- Enter the following formula:
“The Top Selling Product is “ + Bold(FontFormat(label(1,0,0), “red”, “”, 20, “Trebuchet MS”)) + “ with Total Sales of” + Bold(Underline(Format(data(0,0), “$%,.2f”))) + LineBreak() +”And the Boton Seller Product is “ + label(1,0, lookupMinRow(0)) +” with Sales of “ + Underline(Bold(Format(min(dataSetColumn(0)), “$%,.2f”))) + LineBreak() + “Delta between MAx and Min is “ + FontFormat(Format((data(0,0)-data(9,0)), “$%,.0f”), “black”,””,, 20, “Arial”)
- Next we will add the bullet list with the Top 3 product, using another dynamic text field.; with this formula:
FontFormat(“These are the Top 3 Products: “ , “black”, “”, 18, “Verdana”)+LineBreak() + FontFormat(OrderedList(label(1,0,0),label(1,0,1),label(1,0,2)), “black”,””,18, “Verdana”)
If you have questions about these tips (or improvements) please let us know in a comment.
P.S. We will post previous Tip&Tricks as well as all new ones to keep this information active and available to all users.
- 7 mths agoLast active
- 1 Following