Using and setting variables in your packages

Using and setting variables in your package

You can use variables in most components and fields of a package. You cannot use, for example, variables in the limit component or in alias fields.

Variable values are expressions so you can use functions and operators to assign dynamic values to your variables.

Variable values are evaluated only at runtime (when a package is ran), so you must replace these variables with actual values for Xplenty components (like the Schema step) to work in the package designer.

You can use three types of variables:

  • User variables that you define. You also set the default value.
  • System variables for which you can change the default value. See list here.
  • Variables predefined by Xplenty, whose values are set by the system when the job is run. See list here.

Using variables in a variable or a field:

In the required field, type $ followed by the variable name. For example, if the variable name is country, type $country. Note that variables are simply substituted with their values. Therefore if you use a variable where a string value is expected, you should enclose it in single quotes, as in this example: SUBSTRING('$country',3,5)

Setting variable values in your package

Set user and system variable default values in the package designer. If required, you can override these default values when you run a job through the UI (see Running jobs), the scheduler or the API.

To modify a system variable default value in the package:

  1. Click ...(Set variables)
  2. Click system variables.
  3. Type a new default value in the relevant text box.
You can also use the following in system variable values:
  • Predefined variables
  • Another system variable that is listed before the system variable whose value you're editing.

To define a user variable and set its value:
  1. Click ...(Set variables)
  2. On the user variables tab, type a name and a default value in the relevant text boxes.
  3. Add additional variables as required.
You can also use the following in user variable values:
  • Predefined variables
  • System variables
  • Another user variable that is listed before the user variable whose value you're editing.

Creating packages

  1. Creating a new package in New Xplenty
  2. Creating a workflow
  3. Working in the new package designer
  4. Validating a package
  5. Using components: Amazon Redshift Source
  6. Using components: Bing Ads Source
  7. Using components: Database Source
  8. Using components: Facebook Ads Insights Source
  9. Using components: File Storage Source
  10. Using components: Google Adwords source
  11. Using components: Google Analytics Source
  12. Using components: Google BigQuery Source
  13. Using components: Google Cloud Spanner Source
  14. Using components: MongoDB Source
  15. Using components: NetSuite Source
  16. Using components: Salesforce source
  17. Using components: Rest API Source
  18. Using components: Aggregate Transformation
  19. Using components: Assert Transformation
  20. Using components: Clone transformation
  21. Using components: Cross Join Transformation
  22. Using components: Distinct Transformation
  23. Using components: Filter Transformation
  24. Using components: Join Transformation
  25. Using components: Limit Transformation
  26. Using components: Rank Transformation
  27. Using components: Sort Transformation
  28. Using components: Union Transformation
  29. Using components: Window Transformation
  30. Using components: Sample Transformation
  31. Using components: Cube transformation
  32. Using components: Amazon Redshift Destination
  33. Using components: Database Destination
  34. Using components: File Storage Destination
  35. Using components: Google BigQuery Destination
  36. Using components: Google Spanner Destination
  37. Using components: MongoDB Destination
  38. Using components: Salesforce Destination
  39. Using components: Snowflake Destination
  40. Using Components: Rest API Destination
  41. Using and setting variables in your packages
  42. System and pre-defined variables
  43. Using pattern-matching in source component paths
  44. Using ISO 8601 string functions
  45. Using Expressions in Xplenty
  46. Xplenty Functions

Feedback and Knowledge Base