API Data integration – Regular expressions and Value transform features
Use Regex in your API integrations
Intro: DSYNC is a developers tool for integrating multiple APIs. The below is a list of functional rules devs can implement to transform data between multiple endpoints. Devs can map any available rest endpoint with any other available endpoint and transform the data in between with the DSYNC tool.
Example – Data functions can be set up to transform data based on functions example regular expression rules.
Mapping – and Conditional Functional settings include
- Regular Expression Replace
- Value transform function
- Append to string
- String replace (Replace all occurrences of the search string with the replacement string)
- Left Pad
- Email Validation
- Left Trim
- Upper case (Returns string with all alphabetic characters converted to uppercase)
- Lower case substring
- Case sensitive
- Date function
- Current Date / time (Transform a field into the current date and time)
- Time function
- Capitalize string
- Mathematical functions
- If, then else conditions
- Split and pick (Split a string into keys and values and pick a specific value based on a specified key.) includes a Separator feature.
- Round (returns the rounded value to specified precision)
Testing your sync: You can use the DSYNC preview feature to run a check on your conditional logic by clicking on “preview” then in the pop up box simply apply some JSON code to test your logic.
Value transform function – Allows you to specify the input string and what it should be transformed to (Output). You can also apply a default value in case none of the keys match. Developers can also apply rules to check if it is case sensitive or not.
DSYNC also enables a preview function to test the data transformation using regular expressions. When setting up API syncs DSYNC can be used for conditional logic. Fields can be transformed on an individual level. You can apply regular expressions in the data mapping section by selecting the fx icon on your data point. There is a drop-down menu under “Functions” for you to apply conditional logic to your data synchronization.
Note: You can apply multiple regular expression rules to your API data sync.