Global variable setter Transformer

Table of contents

  • Introduction
  • Guide

Introduction

Managing multiple e-commerce stores often means dealing with similar integration setups that differ only in small details, for example, fetching data from Storage NL for the Dutch store and Storage FR for the French one. To simplify this process, the Global Variables feature allows you to define and reuse values across your entire integration flow. This helps reduce duplication, makes configurations easier to maintain, and ensures a more efficient way to handle multi-store or multi-language environments.

To navigate to the feature, go to Transformers → Create a new transformer → Select “Global variable setter”.

Guide

The global variable setter enables the creation of temporary variables outside the item data. The value of a global variable can be used with a placeholder such as @{globals.my_variable}. The variable only exists for the duration of the process.

Step 1: After selecting the “Global variable setter” transformer, enter the Key and Value fields below.

  • The Key is used to set the name of the variable. The key is a path separated by dots. path.to.target becomes a nested element represented as plain text:

`globals

  • path
    – to
    — target = value `

The placeholder to use the variable would become @{globals.path.to.target}.

  • The Value needs to be set in the defined context path. Placeholders can be used to obtain data from the context.

Step 2: Once you save the transformer, you can also create another one (whether as a chain or a separate transformer) where placeholders can be used, such as a Value setter. You can enter the global variables there, chain two transformers, and run them to ensure that reusing variables works as expected.

3 Likes