Transform data using Code Studio in Zoho DataPrep

Transform data using Code Studio [BETA]



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.

Idea
Important: This option 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.
Idea
Important: Make sure the account admin has enabled the Prepare data using Code Studio toggle in the Settings page under Feature Control tab.



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. 



Alert
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.

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.

Notes
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. 

Notes
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. 
Notes
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.
By default, the compute configuration is set to 1 CPU and 1 GB RAM.  

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. 



SEE ALSO

      Create. Review. Publish.

      Write, edit, collaborate on, and publish documents to different content management platforms.

      Get Started Now


        Access your files securely from anywhere

          Zoho CRM Training Programs

          Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

          Zoho CRM Training
            Redefine the way you work
            with Zoho Workplace

              Zoho DataPrep Personalized Demo

              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.

              Zoho CRM Training

                Create, share, and deliver

                beautiful slides from anywhere.

                Get Started Now


                  Zoho Sign now offers specialized one-on-one training for both administrators and developers.

                  BOOK A SESSION







                              Quick LinksWorkflow AutomationData Collection
                              Web FormsEnterpriseOnline Data Collection Tool
                              Embeddable FormsBankingBegin Data Collection
                              Interactive FormsWorkplaceData Collection App
                              CRM FormsCustomer ServiceAccessible Forms
                              Digital FormsMarketingForms for Small Business
                              HTML FormsEducationForms for Enterprise
                              Contact FormsE-commerceForms for any business
                              Lead Generation FormsHealthcareForms for Startups
                              Wordpress FormsCustomer onboardingForms for Small Business
                              No Code FormsConstructionRSVP tool for holidays
                              Free FormsTravelFeatures for Order Forms
                              Prefill FormsNon-Profit

                              Intake FormsLegal
                              Mobile App
                              Form DesignerHR
                              Mobile Forms
                              Card FormsFoodOffline Forms
                              Assign FormsPhotographyMobile Forms Features
                              Translate FormsReal EstateKiosk in Mobile Forms
                              Electronic Forms
                              Drag & drop form builder

                              Notification Emails for FormsAlternativesSecurity & Compliance
                              Holiday FormsGoogle Forms alternative GDPR
                              Form to PDFJotform alternativeHIPAA Forms
                              Email FormsFormstack alternativeEncrypted Forms

                              Wufoo alternativeSecure Forms

                              TypeformWCAG

                                All-in-one knowledge management and training platform for your employees and customers.


                                            Create. Review. Publish.

                                            Write, edit, collaborate on, and publish documents to different content management platforms.

                                            Get Started Now




                                                              You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                                  Manage your brands on social media


                                                                    • Desk Community Learning Series


                                                                    • Digest


                                                                    • Functions


                                                                    • Meetups


                                                                    • Kbase


                                                                    • Resources


                                                                    • Glossary


                                                                    • Desk Marketplace


                                                                    • MVP Corner


                                                                    • Word of the Day


                                                                    • Ask the Experts


                                                                      Zoho Sheet Resources

                                                                       

                                                                          Zoho Forms Resources


                                                                            Secure your business
                                                                            communication with Zoho Mail


                                                                            Mail on the move with
                                                                            Zoho Mail mobile application

                                                                              Stay on top of your schedule
                                                                              at all times


                                                                              Carry your calendar with you
                                                                              Anytime, anywhere




                                                                                    Zoho Sign Resources

                                                                                      Sign, Paperless!

                                                                                      Sign and send business documents on the go!

                                                                                      Get Started Now




                                                                                              Zoho TeamInbox Resources





                                                                                                        Zoho DataPrep Demo

                                                                                                        Get a personalized demo or POC

                                                                                                        REGISTER NOW


                                                                                                          Design. Discuss. Deliver.

                                                                                                          Create visually engaging stories with Zoho Show.

                                                                                                          Get Started Now








                                                                                                                              • Related Articles

                                                                                                                              • Export data to Zoho Creator

                                                                                                                                Zoho DataPrep supports exporting data to Zoho Creator using the Zoho Creator connector. Zoho Creator is a powerful low-code application development platform that helps businesses build custom web and mobile apps faster. To export data to Zoho Creator ...
                                                                                                                              • Zoho DataPrep Studio

                                                                                                                                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. ...
                                                                                                                              • Zoho CRM connector for Zoho DataPrep

                                                                                                                                Zoho DataPrep allows you to seamlessly bring in your sales data from Zoho CRM using the Zoho CRM connector. Using the connector, you can import your sales data from CRM to perform ETL operations like data cleanup, data migration, data sync, and data ...
                                                                                                                              • Reload data

                                                                                                                                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 ...
                                                                                                                              • Join

                                                                                                                                You can join two datasets together using common columns using the Join transform. For example, consider a dataset which has the purchase data of a store and another dataset with their customer information. These datasets can be combined using a ...
                                                                                                                                Wherever you are is as good as
                                                                                                                                your workplace

                                                                                                                                  Resources

                                                                                                                                  Videos

                                                                                                                                  Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                                                  eBooks

                                                                                                                                  Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                                                  Webinars

                                                                                                                                  Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                                  CRM Tips

                                                                                                                                  Make the most of Zoho CRM with these useful tips.



                                                                                                                                    Zoho Show Resources