Global Variable
In Reportana’s advanced automations and campaigns, you have access to the global variable payload
, which can be used to access data within arrays and objects. This variable allows you, for example, to retrieve specific information from an array of orders and manipulate that data as needed. Additionally, the payload
variable can be used within the Execute JavaScript block, providing even more customization options for the scripts executed through this feature. See the example below:
In this example, we store the total order value in the variable totalPrice
by accessing the payload.order
object and its total_price
attribute (the total order amount). This allows us to perform, for instance, a calculation to automatically apply a discount coupon to the total order value: