Data transformation using Code Studio in Zoho DataPrep involves manipulating and preparing raw data for analysis in a structured data pipeline. By writing custom code, you can clean, transform, prepare, enrich and restructure data to suit your needs. This process allows you to integrate data from multiple sources, handle missing values, create new calculated fields, and apply complex logic to enhance data quality. For example, consider CRM data flowing in from various sources—we can consolidate and organize this data efficiently to generate more accurate insights.
Important: This feature is supported in the US, IN and EU DCs only.
How to access Code Studio?
1. Open an existing pipeline or create a new one and import data into it. This creates a stage for the data source. Right-click the stage and choose the Add Code Stage option.
2. This creates a code stage and a default output stage. Right-click the code stage to view the following options:
Edit: Opens the Code Studio Editor to modify the code.
Delete – Removes the code stage from the pipeline. You can click the undo icon to revert the changes if needed or if it was deleted by mistake.
Add Code Input stage – This option highlights the code stage and you can connect any stage to the code stage title by clicking and dragging the arrow to add as input data to your code.
Add Code Output stage – Adds an additional output stage connected to the code stage.
Transform data using Code Studio
3. The Code Studio Editor page will open with a sample code in it.
Code Editor: The central section of the Code Studio Editor is a dedicated Python environment for writing, editing, and executing code to clean and transform data.
Library: Located on the left side of the Code Editor, this section includes default libraries. You may also upload files and libraries into Code Studio apart from the default libraries.Click the + Add icon at the top to create a new file, upload a file, or add a library. Library acts as a file directory for all the folders and its files.
Important : Ensure that you update the input stage name in fetch_stage_input_as_dataframe() and the output stage name in save_stage_output_from_dataframe() to match the exact names used in your pipeline. Replace "Stage 1" and "StoreSalesProcessed" in the sample code with your actual code stage and output stage names. Only then the code will execute successfully in your pipeline. If the stage names do not match, the execution will fail throwing an error.
4. Enter the Python script into the Code Studio Editor to transform and prepare your data. Make sure you give a name and save the script.
Important: Code Studio can only make API calls to domains added to the allowed list by your account admin. Click here to learn more.
5. Once completed, click the Test Run at the top to validate the script. The transforms will be applied on the first 100 rows of data.
Note: The Test run will make changes only on the sample data and not on the complete dataset.
6. You can check the results of the Test Run in the Output and logs in the Console sections at the bottom.
Console: A text-based interface used for debugging and troubleshooting. Any errors in the script will be displayed here. You can fix them and execute a test run again.
Output: Displays a preview table for the executed script.
7. Once you achieve the desired output, you can go ahead and Deploy the changes.
8. Click Deploy. Provide a version name and description. Once Deployed, the final output will be saved in the output stage and will be enabled. Deploying the code will apply changes in the full dataset. You can click open the output stage and view data in the DataPrep Studio page.
Note: The output stage remains disabled until the code is deployed. You must deploy the code at least once to enable and access this stage in DataPrep Studio page.
10. Now you can add destination to the output stage and execute the pipeline to export data.
Note: Code Studio follows a pay-as-you-go pricing model. Credits are deducted based on the selected compute capacity. For example, a 1 GB (2 CPU) configuration consumes 1 credit per minute. Please ensure your payment settings are configured before use. Each deployment consumes 1 credit. The compute size refers to the allocated memory and CPU resources used to execute and deploy your code.
Go to the ellipses icon from the pipeline builder, and click on the Job history option. You can view the details of the execution here. You can filter out these pipelines using the Code executions filter option.
Other options in the Code Editor
1. You can click the ellipses icon in the top-right corner to access the following features:
Run last deployed version: Executes the most recently deployed version of the script without requiring any new changes to be published.
View Last Run Logs: Displays the execution status, logs, and detailed information from the most recent run to help monitor performance and troubleshoot issues.
Version Details: Provides information about the deployed versions of the script.
Download: Downloads the script in a zip file.
2. Click the ⌘ icon to use the basic keyboard shortcuts in the Code Studio Editor.
Track changes in Code Studio
The Version history option helps you keep track of all the actions done in a pipeline. You can access the Version history from the Last saved link at the top of the pipeline builder. This keeps track of all changes made to the Code Studio stage. This includes renaming the stage, updating the code (every time you click Save), and adding or modifying input and output stages. If the pipeline is currently published or live, making any changes will automatically move it back to Draft so the updates can be reviewed before publishing again.
If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.
Install the PageSense code snippet on your site in a matter of minutes and start collecting in-depth data about the website visitors to grow your business.
Set up goals in PageSense to measure every single action performed by visitors on your website like button or link clicks, form submissions, and page engagements.
Create funnels in PageSense to quickly see which pages visitors use to enter your website, where they navigate to next, and which pages they decide to leave without converting.
Visualize your visitor's behavior with color codes
Set up heatmaps in PageSense to see where users have clicked more, how far they've scrolled, and on which parts of a page they've spent the most time using color-coded patterns in reports.
Use form analytics in PageSense to see how people interact with different fields in your form, whether they complete the form successfully or not, and where exactly they drop out on your form.
Use session recordings in PageSense to watch a video of all the visitor actions performed on your website including the pages they navigate, the buttons they click, the UX issues they face, and more.
Run A/B or Split URL tests in PageSense to figure out which version of your web page works best for your business and results in the best conversion rate.
Use personalization in PageSense to deliver customized versions of your website for every individual customer based on their demographics, local weather, browsing history, and more.
Run polls on your website using PageSense to understand what your customers think about your products/services and what needs improvement on your site.
Use web push notifications in PageSense to schedule and notify your customers about an upcoming flash sale, product releases, promotional coupons, and a lot more that can spark conversions on your website.
Use pop-ups in PageSense to instantly grab the attention of visitors by showing attractive signup offers, coupon code discounts, or email newsletters that can eventually convert them into subscribers.
Use PageSense's advanced features like creating mutually exclusive groups, enabling cross-domain tracking, configuring customized project JS, and more to get deeper insights about your website.
Download the PageSense extension app available for your web browser with a few clicks and start collecting all of your required website metrics in real time.
Discover your favorite integrations with PageSense
Get a deeper look at your website's data by seamlessly integrating PageSense with a host of popular third-party apps like Google Analytics, Mixpanel, Intercom, and more.
Use the Zoho CRM connector to import data from Zoho CRM into Zoho DataPrep, where you can clean, transform, and prepare your sales data for operations like data cleanup, data migration, data sync, and data backup. You can load your prepared data into ...
An overview of data preparation in the Studio page is covered in the following sections: Data distribution Data quality Intelligent suggestions Search & filter Topbar The image above displays the Studio page and all the sections associated with it. ...
You can manually refresh your stage with the latest data by reloading data from your data source. You can use the manual reload option to fetch data that was failed during a schedule. This is part of your ETL workflow for data movement, ensuring ...
You can enter the URL to a CSV, TSV, JSON, HTML, XLS, XLSX or XML file. DataPrep also supports URL imports that require authentication. To import files from URLs 1. Create a workspace or open an existing workspace. Click here to see how to create a ...
Zoho DataPrep allows you to export data to Panoply, a fully-integrated data management platform that syncs, stores, organizes and analyzes data from many sources. To export data to Panoply 1. Open an existing pipeline or create a pipeline from the ...