Product documentation
Patchworks services
Patchworks services
  • Services documentation
  • Getting started
    • What is a service?
  • Roles & Permissions
    • Roles & permissions summary (services)
  • Working with Services
    • Accessing services
    • The services list
    • The anatomy of a service
      • Service summary
      • Service canvas
      • Service filters
      • Service trigger
      • Service source
      • Service destination
      • Service mapping
      • Service alerts
      • Payload script
      • Run service
      • Service settings
    • Adding a Patchworks service
      • Add a default service
      • Configure service settings
      • Set the service trigger schedule
      • Define service filters
      • Define field mappings
      • Activate the service
    • Cloning an existing service
    • Updating a service
      • Service notes
      • Using a payload-level custom script in services
    • Removing a service
    • Field mappings & transformations (services)
      • Field mappings (services)
        • Mapping metafields for products (services)
      • Field transformations (services)
        • Transform function reference (services)
        • Using a custom script in field transformations (services)
      • Transform mapping/lookup tables (services)
      • Legacy shipment & payment maps (services)
  • Service connectors
    • What is a service connector?
    • Accessing service connectors
    • The anatomy of a service connector
    • Adding a service connector
    • Updating a service connector
    • Removing a service connector
  • Reporting & logging
    • Service sync reports
      • Viewing the service sync report
      • Handling failed service syncs
      • Sync failure email notifications
    • Service sync logs
    • Viewing logs for custom script activity in services
  • Service systems
    • Service systems
    • Supported service systems
      • Active Ants (service connector)
        • Finding service connector credentials for Active Ants
      • BigCommerce (service connector)
        • Finding service connector credentials for BigCommerce
        • Additional setup notes for BigCommerce (services)
      • Bleckmann (service connector)
        • Finding service connector credentials for Bleckmann (API)
      • Bleckmann Returns (service connector)
        • Finding service connector credentials for Bleckmann (Returns)
      • Bleckmann SFTP (service connector)
        • Finding service connector credentials for Bleckmann (SFTP)
      • Brightpearl (service connector)
        • Finding service connector credentials for Brightpearl
        • Additional setup notes for Brightpearl (services)
      • Business Central (service connector)
        • Finding service connector credentials for Business Central
      • Citrus-Lime (service connector)
        • Finding service connector credentials for Citrus-Lime
      • CommerceTools (service connector)
        • Finding service connector credentials for CommerceTools
      • Cybertill (service connector)
        • Finding service connector credentials for Cybertill
      • Descartes Peoplevox (service connector)
        • Finding service connector credentials for Peoplevox
        • Configuring Peoplevox as a data destination (services)
        • Quick setup CSV files for Peoplevox (services)
      • Dynamics NAV (service connector)
        • Finding service connector credentials for Dynamics NAV
      • Emarsys (service connector)
        • Finding service connector credentials for Emarsys (FTP)
      • EposNow (service connector)
        • Finding service connector credentials for EposNow
      • Global-e (service connector)
        • Finding service connector credentials for Global-e
      • Inventory Planner (service connector)
        • Finding service connector credentials for Inventory Planner
      • Khaos Control (service connector)
        • Finding service connector credentials for Khaos Control
      • Lightspeed Retail R-Series (service connector)
        • Authorising Patchworks to access your Lightspeed Retail R-Series account (services)
      • Lightspeed Retail X-Series (service connector)
      • Linnworks (service connector)
        • Finding service connector credentials for Linnworks
      • Magento 2 (service connector)
        • Finding service connector credentials for Magento 2
        • Required settings for Magento 2.4.4+ (services)
      • Mirakl (service connector)
        • Finding service connector credentials for Mirakl
      • Navision (service connector)
      • NetSuite (service connector)
        • Authorising Patchworks to access your NetSuite account (services)
        • Required NetSuite features (services)
        • Working with NetSuite custom fields (services)
        • Setting unique IDs for NetSuite product syncs (services)
        • NetSuite concurrency (services)
        • Troubleshooting NetSuite connections (services)
        • Additional setup notes for NetSuite (services)
        • Legacy service connector setup for NetSuite
          • Installing the Patchworks bundle for NetSuite (services)
          • Finding connector credentials for NetSuite (services)
      • Odoo (service connector)
        • Finding service connector credentials for Odoo
      • Ometria (service connector)
        • Finding service connector credentials for Ometria
      • Patchworks SFTP (service connector)
        • Finding basic auth service connector credentials for SFTP
        • Finding ssh auth service connector credentials for SFTP
        • Specifying a non-root folder as the file location (services)
        • Adding entity schemas (services)
      • Plytix (service connector)
        • Finding service connector credentials for Plytix
      • Prima (service connector)
        • Finding service connector credentials for Prima
      • ReBound (service connector)
        • Finding service connector credentials for ReBound
      • SAP Business One (service connector)
        • Finding service connector credentials for SAP Business One
      • Seko (service connector)
        • Finding service connector credentials for Seko (API)
        • Finding service connector credentials for Seko (FTP)
      • Shopify / Shopify+ (service connector)
        • Finding service connector credentials for Shopify (token auth)
        • Finding service connector credentials for Shopify (legacy auth)
        • Additional setup notes for Shopify (service connector)
      • Sitoo (service connector)
        • Finding service connector credentials for Sitoo
      • SparkLayer (service connector)
        • Finding service connector credentials for SparkLayer
      • The Edge by John Lewis (service connector)
        • Finding service connector credentials for The Edge by John Lewis
      • TikTok Shop (service connector)
        • Finding service connector credentials for TikTok Shop
      • Torque (service connector)
        • Finding service connector credentials for Torque
      • Veeqo
        • Finding service connector credentials for Veeqo
      • Vend (service connector)
        • Finding service connector credentials for Vend
      • Visualsoft (service connector)
        • Finding service connector credentials for Visualsoft
      • Voyado (service connector)
        • Finding service connector credentials for Voyado
      • WooCommerce (service connector)
        • Finding service connector credentials for WooCommerce
      • ZigZag (service connector)
        • Finding service connector credentials for ZigZag
  • Troubleshooting
    • How to manage failed service syncs
    • How to run a service manually
    • How to deactivate/activate a service
    • How to check the operational status of a service connector
    • What to check if you can't save a new service connector
    • How to handle an empty mapping page
    • What to do if your third-party systems go offline
  • Inbound API
    • Inbound API for services
    • Using the Inbound API connector with Patchworks services
      • Adding an inbound API connector with a custom payload
      • Generating token credentials for API access
      • Adding a Patchworks service for an inbound API connector
        • Add a default service
        • Configure service settings
        • Set the service trigger schedule
        • Define field mappings
        • Activate the service
      • Implementing API requests
  • Support
    • Raising a support ticket
Powered by GitBook
On this page
  • Field transformation function types
  • Common
  • Text (String)
  • Number (Integer (123) / Float (123.456))
  • Boolean (True/False)
  • Date / DateTime
  1. Working with Services
  2. Field mappings & transformations (services)
  3. Field transformations (services)

Transform function reference (services)

Field transformation function types

Common

Transformation
Description
Input Value
Transform Value
Output Value

Custom Value (True or False)

Enter a customer value as True/False (Boolean)

TRUE

TRUE

Custom Value (Date)

Enter a customer value as Date (DateTime)

01/13/2022

01/13/2022

Custom Value (Number)

Enter a customer value as Number (Integer)

123

123

Custom Value (Text)

Enter a customer value as Text (String)

Example

Example

Get Date

Return the current datetime

(Todays Date)

Get Unique Ref

Random Number

Return a random number at a specified length

5

98765

Run Custom Script

Selected script

Script return vaulue

5

Text (String)

Transformation
Description
Input Value
Transform Value
Output Value

Contains

Check if a string contains text

Example String

"stri"

TRUE

Decode (URL)

Convert an encoded URL into a readable format

example%20string

Example String

Encode (URL)

Convert a string to a URL encoded string

Example String

example%20string

First Word

Get the first word from a string

Adam David John Smith

Adam

Get Country Code

Return the country code for a country name

Germany

12

Get Country Name

Return the country name for a country code

12

Germany

Hash

Convert a string to a SHA1 Hash

Example String

77077529426442283f684c6732a765801f938f94

Last Word

Get the last word from a string

Adam David John Smith

Smith

Lowercase

Convert a string to lowercase

Example String

example string

Max Length

Set the maximum number of returned characters

Example String

10

Example St

Middle Words

Get the middle word(s) from a string

Adam David John Smith

David John

Pad

Add characters before,around,after a string

Example String

Both, 18, X

XXExample StringXX

Prefix

Add a string to the beginning

Example String

TEST

TESTExample String

Propercase

Uppercase the first letter in each sentence

EXAMPLE STRING

Example string

Remove

Remove a string

Example String

ample

Ex String

Clean string

(i) Remove or replace special characters in a string

$_Example String!

replace = X

X_ExampleXStringX

(ii) Remove all non-alphanumeric characters in a string

$_Example String!

alphanumeric_only = true

ExampleString

(iii) Replace all non-alphanumeric characters in a string

$_Example String!

alphanumeric_only = true replace = X

XXExampleXStringX

Replace

Replace any characters with another

Example String

e, X

XxamplX String

Substring (After)

Return characters after a value

Example String

pl, 5

e Str

Substring (Before)

Return characters before a value

Example String

pl, 5

Exam

Substring (Between)

Return characters between a two values

Example String

pl, g

e Strin

Substring (Range)

Return characters within a range

Example String

"3 , 7

mpl

(i) Using negative values allows you to return the end of a string

Example String2

"-1, -4

ing2

Suffix

Add a string to the end

Example String

Test

Example StringTest

Trim

Remove any characters around a string

xExample Stringxx

Both, x

Example String

Uppercase

Convert a string to uppercase

Example String

EXAMPLE STRING

Number (Integer (123) / Float (123.456))

Transformation
Description
Transform Value
Output Value

Calculate matching key

Perform a simple calculation (+ - / *)

123

"/ , 5

24.6

Ceiling

Round up to the nearest whole number

24.4

25

Convert Weight

Convert a weight (mg, g, kg, lb, oz)

25

kg, g

25000

Floor

Round down to the nearest whole number

24.6

24

Reverse Sign

Convert a negative number to a positive number or vis versa

24.6

-24.6

Round

Round to specified number of decimal places

12.34567

2

12.34

To Negative

Return a negative value

-24

-24

To Positive

Return a positive value

-24

24

Boolean (True/False)

Transformation
Description
Input Value
Transform Value
Output Value

Reverse

Convert a negative to a positive or vis versa

TRUE

FALSE

Date / DateTime

Transformation
Description
Input Value
Transform Value
Output Value

Adjust Date

Add or Subtract units (Seconds, Minutes, Hours, Days, Weeks, Months, Years)

4/Jul/2022

+ , 100, Days

12/Oct/2022

Convert Date

Convert a date to another timezone / format

4/Oct/2022 12:00

gmt > hk, dd-MMMM-yy

"04-October-22 20:00

Convert to String

Convert a date to a string

4/Oct/2022 12:00

y/m/d

2022/10/4

Date Comparison

Check if a date is before/equal/after

4/Jul/2022

Before, 10/Jul/2022

TRUE

Date Diff

Return the difference between 2 dates

4/Jul/2022

15/Jul/2022, days

14

c

PreviousField transformations (services)NextUsing a custom script in field transformations (services)

Run an existing

custom script