The Transformation Script Editor in Unbxd PIM provides two views for performing data transformations: Code View and Tool View. Here’s an overview of how to use each view:
Code View:
Click on Add Transformation.
Choose Code View to directly write the script for data transformations.
Enter your code in the provided editor.
If you want to preview the output of your code, click on Preview Output.
Click Save to save the script.
Tool View:
Click on Add Transformation.
Select Tool View to perform data transformations without writing scripts.
The Attribute list displays available product attributes.
To view sample values of a attribute, click on Show sample values.
The sample values appears on the right side of the window. If you want to view sample values for other attributes from here, select another attribute, and then click .
In the Select Operation list, select an operation for the data transformation. The operations are
Operations
Sample Scenario
Steps
Text Rules
Copy
Populate the “Long Description” attribute with the content from the “Short Description” attribute for all products in your product catalog
In the Select Operation list, select Copy.
In the Attributes dropdown list select the attribute from which you want to copy the value
Set
Automate the process of setting the brand name for products in your Unbxd PIM product catalog
In the Select Operation list, select Set.
In the Value text box enter the value which you want to set for the attribute
Replace
Replace all occurrences of “Crimson” for the attribute “Color” with “Red”
In the Select Operation list, select Replace.
In the Replace Value box, type the attribute value you want to replace.
In the Replace With box, type the new value.
Join
Join two attributes “ Brand” and “Product Name” using the joining value “-”
In the Select Operation list, select Join.
In the Join by Value box, type the character you want to use to join the the two attribute values.
In the Attributes box, select the second attribute.
Prefix
Prefix (add something at the beginning) US currency “$” for the attribute “Price”
In the Select Operation list, select Prefix.
In the Prefix With box, type the character you want to add before the attribute value.
Suffix
Suffix (add something at the end) registered trademark to the values of the attribute “Product Name”
In the Select Operation list, select Suffix.
In the SuffixWith box, type the character you want to add after the attribute value.
Split & pick
Split the attribute “Image URL” and pick the image nameExample: https://xyz.shopc.com/LCProdThumb/17/4/174833handbag.jpgSplit the image url with “/” and pick the image name “174833handbag.jpg”When you specify the “split by” value as “/” and the “pick position” value as “6”, and execute the script, the url first splits into the following: – https: (Position 0) – Empty space (Position 1) – xyz.shopc.com (Position 2) – LCProdThumb (Position 3) – 17 (Position 4) – 4 (Position 5) – 174833handbag.jpg (Position 6)The result will be 174833handbag.jpg
In the Select Operation list, select Split and Pick.
In the Split by box, enter the character using which you want to split attribute value.
In the Pick item at position box, enter the position number using which you want to pick the specific part of the attribute value.
Remove HTML
You have a product catalog in Unbxd PIM that includes a attribute called “Product Description.” However, some of the product descriptions contain HTML tags, such as, , or . To present the product information in a more readable format and remove the HTML tags, you can use the Remove HTML Tag operation.
In the Select Operation list, select Remove HTML.
Remove special character
You have a product catalog in Unbxd PIM that includes a attribute called “Product Name.” However, some of the product names contain special characters such as symbols or punctuation marks. To ensure consistency and improve data quality, you want to remove these special characters from the product names using the Remove Special Character operation.
In the Select Operation list, select Remove special character.
Generate Partial Search
You have a product catalog in Unbxd PIM with a attribute called “Product Name.” To improve search accuracy and provide better search results to users, you want to generate partial search terms based on the product names. This will enable users to find products even if they enter a partial or incomplete search query.
In the Select Operation list, select Generate Partial Search.
Lower Case
You have a product catalog in Unbxd PIM that includes a attribute called “Product Title.” However, the product titles are inconsistently formatted, with some in uppercase, others in title case, and some in lowercase. To ensure uniformity and improve the overall presentation, you want to convert all product titles to lowercase using the Lowercase operation.
In the Select Operation list, select Lower Case.
Upper case
You have a product catalog in Unbxd PIM that includes a attribute called “Product Name.” However, the product names are inconsistently formatted, with some in lowercase, others in title case, and some in uppercase. To ensure uniformity and improve the overall presentation, you want to convert all product names to uppercase using the Uppercase operation.
In the Select Operation list, select Upper Case.
Title Case
You have a product catalog in Unbxd PIM that includes a attribute called “Product Description.” However, the product descriptions are inconsistently formatted, with some in uppercase, others in lowercase, and some in mixed case. To ensure uniformity and improve the overall presentation, you want to convert all product descriptions to title case using the Title Case operation.
In the Select Operation list, select Title Case.
Capitalize
You have a product catalog in Unbxd PIM that includes a attribute called “Product Category.” However, the category names are inconsistently formatted, with some in lowercase, others in uppercase, and some in mixed case. To ensure uniformity and improve the overall presentation, you want to capitalize the first letter of each word in the category names using the Capitalize operation.
In the Select Operation list, select Capitalize.
Zero Pad
You have a product catalog in Unbxd PIM that includes a attribute called “Product Code.” The product codes are numeric values, but some of them have inconsistent lengths. To standardize the formatting and ensure a consistent number of digits, you want to add leading zeros to the product codes using the Zero Pad operation.
In the Select Operation list, select Zero Pad.
Number Rules
Addition
Add two numerical attribute values for attributes “ Base Price” and “Delivery Charges”. That is,Actual price = Base price + Delivery charges
In the Select Operation list, select Addition.
In the Attribute box, select the property you want to use for addition.
To include multiple attributes for addition, click .
Subtraction
Subtract two numerical attribute values for attributes “ Actual Price” and “Discounted Price”. That is, Offer Price= Actual Price- Discount Price
In the Select Operation list, select Subtraction.
In the Attribute box, select the attribute you want to use for subtraction.
To include multiple attributes for subtraction, click .
Multiplication
Multiply two numerical attribute values for properties “Number of Units” and “Price per Unit”. That is, Total Price = “Number of Units” * “Price per Unit”
In the Select Operation list, select Multiplication.
In the Attribute box, select the property you want to use for multiplication.
To include multiple attributes for multiplication, click .
Division
Divide two numerical attribute values for attributes “Total Weight of the Products” and “Total Weight of the Carton”. That is, Per Unit Weight = Total Weight of the Products / Total Weight of the Carton
In the Select Operation list, select Division.
In the Attribute box, select the property you want to use for division.
To include multiple attribute for division, click .
Add number value
Product catalog in Unbxd PIM includes a attribute called “Price.” However,to increase all product prices by a specific value, such as a discount or tax percentage. To automate this calculation and update the prices accordingly,use the Add Number Value operation.
In the Select Operation list, select Add number value.
In the Text box,Enter the value by which you want to add on .
To include multiple attributes for Add number values, click .
Substract number value
Product catalog in Unbxd PIM includes a attribute called “Price.” However, to increase all product prices by a specific value, such as a discount or tax percentage. To automate this calculation and update the prices accordingly, you can use the Add Number Value operation.
In the Select Operation list, select Substract number value.
In the Text box,Enter the value by which you want substract .
To include multiple attributes for Substract number values, click .
Multiply number value
Product catalog in Unbxd PIM includes a attribute called “Unit Price.” However, you want to adjust the prices based on a specific factor, such as a markup or discount percentage. To automate this calculation and update the prices accordingly, you can use the Multiply Number Value operation.
In the Select Operation list, select Multiply number value.
In the Text box,Enter the value by which you want multiply the value.
To include multiple attributes for Multiply number values, click .
Divide number value
Product catalog in Unbxd PIM includes a attribute called “Unit Price.” However, you want to adjust the prices based on a specific factor, such as a markup or discount percentage. To automate this calculation and update the prices accordingly, you can use the Divide Number Value operation.
In the Select Operation list, select Divide number value.
In the Text box,Enter the value by which you want divide the value.
To include multiple attributes for Divide number values, click .
Percentage
Get % portion of a particular attribute value. That is,Offer Price= 80% of Actual Price
In the Select Operation list, select Percentage.
In the Percentage portion box, enter the percentage value.
Convert Integer to float
Product catalog in Unbxd PIM includes a attribute called “Weight.” However, the weight values are currently stored as integers, representing whole numbers. To provide more precise weight information, convert the integer values to floating-point numbers.
In the Select Operation list, select Convert Integer to float.
Ceil
If a product has an average rating of 3.7, applying the Ceiling operation with zero decimal places will round it up to 4. Similarly, if another product has an average rating of 2.2, it will also be rounded up to 3
In the Select Operation list, select Ceiling.
Convert float to integer
You have a product catalog in Unbxd PIM that includes a attribute called “Quantity.” The quantity values are currently stored as floating-point numbers, but you want to represent them as whole numbers without decimal places for consistency and simplicity. To achieve this, you can use the Convert Float to Integer operation.
In the Select Operation list, select Convert Integer to float.
Round off
Round off the attribute values of a attribute “Weight” upto two decimal placesThat is, the value 114.7261 will become 114.73
In the Select Operation list, select Round off.
In the Round off to box, enter the value for the decimal places.
Import Utility Rules
Merge
Product data coming from multiple sources, each containing specific information about the products. To create a unified view of the products and consolidate the data,use the Merge operation within an Import Utility rule.
In the Select Operation list, select Merge.
In the Attribute box, select the property to merge.
DeDuplicate
You have an import file containing product data from different sources, and there might be instances where duplicate products exist with slightly different information. To streamline your product catalog and avoid duplicates, you can use the De-duplicate operation within an Import Utility rule.
In the Select Operation list, select DeDuplicate/strong>.
In the UID key box, enter the value
Select the attribute from the attribute list
To combine multiple operations, click Add another operation.
To copy the automatically generated code, click Copy Code.
If you want to preview the output of your code, click on Preview Output.