What Is a Conditional Parameter Tag? #
A docx report is linked to an article category. An article category can contain multiple articles – which have their own unique set of parameters. How do you ensure that a single docx report can still function for multiple articles and their diverse array of parameters?
The answer is by using conditional parameter tags. A conditional parameter tag allows you to get the correct parameter value on your docx report. This can be highly useful, when an ERP system automatically pushes product orders to Azumuta, where some parameters should be filled and others are not.
Note: Before following the steps below, you must first link a docx report to an article category.
How to Add a Conditional Parameter Tag to a Docx Report #
A conditional parameter tag can be added by typing the following formula:
{#p_<parameter>}{p_<parameter>}{/p_<parameter>}{^p_<parameter>} text of your choice{/p_<parameter>}
This formula can be interpreted as:
- When the chosen <parameter> has the value ({#p_…}), then this value will be filled in.
- If the selected parameter has no value ({^p_…}), then a text of your choice will be displayed instead.
Tip: You can hide rows in a docx report table when a parameter is not entered. You can do this by putting {#p_<parameter>} in the first column of the row and in the last column of the row of {/p_<parameter>}. This row will only be shown when the selected parameter mentioned on <parameter> is filled in within the (<parameter>) space.
Example #
In this scenario, we will use a washing machine as an example. The washing machine factory produces two types of washing machines: a digital washing machine and an analog washing machine.
A digital washing machine has the same parameters as an analog washing machine, with the exception of its control panel. A digital washing machine has an LED control panel. Meanwhile, an analog washing machine was a dial control panel.
This is the parameters list of the digital washing machine:
And this is the parameters list of the analog washing machine:
As we can see, for No. 1-3, both washing machines have the same parameter keys. However, there’s a difference in parameter keys on No.4. The digital washing machine has “Digital Control Panel”, while the analog washing machine has “Analog Control Panel”.
This factory uses the same docx report template for the digital washing machine and the analog washing machine (as they fall still under the same article category: washing machine). Thus, all four parameters will still exist on each docx report.
However, on the docx report for a digital washing machine, we want the “Analog Control Panel” parameter to be filled with “None” (as a digital washing machine doesn’t have an analog control panel). How do we do that?
In this example, we will create the docx report for the digital washing machine, as the docx report for the analog washing machine will follow the same steps and formulas.
Inputting the Conditional Parameter Tag #
For parameters No.1-3, we used standard parameter tags, since both digital & analog washing machines have the same parameter keys for No.1-3 (you can consult the images above to check the parameter keys of both digital & analog washing machines).
For parameters No. 4-5, we used conditional parameter tags. Here’s the parameter tag formula:
- {#p_parameter name}{p_parameter name}{/p_parameter name}{^p_parameter name} text of your choice{/p_parameter name}
The parameter name for No.4 is “Digital Control Panel”. Meanwhile, if the washing machine has no digital control panel, we want the text “None” to be displayed (although this will not be the case for this docx report). Therefore, we typed in:
- {#p_Digital Control Panel}{p_Digital Control Panel}{/p_Digital Control Panel}{^p_Digital Control Panel}None{/p_Digital Control Panel}
The parameter name for No.5 is “Analog Control Panel”. And if the washing machine has no digital control panel, we want the text “None” to be displayed (this will be the case for this docx report). Therefore, we typed in:
- {#p_Analog Control Panel}{p_Analog Control Panel}{/p_Analog Control Panel}{^p_Analog Control Panel}None{/p_Analog Control Panel}
And this is how it will appear on the docx report (click here to learn how to download a docx report):