--- title: "Replace Function" slug: "replace-function" updated: 2022-02-03T01:26:33Z published: 2022-02-03T01:26:33Z canonical: "docs.datajet.app/replace-function" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.datajet.app/llms.txt > Use this file to discover all available pages before exploring further. # Replace Function Version 4.2.3.1 ## Overview Accessible through Engineering->Function Field REPLACE(A,B,C) in string functions where A is the source field, B is the original string to search for and C is new string replace B ## Example The following script will create a new field from occupation, replacing "programmer" with "coder" and report and changes made ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1643843345471.png) ```json [ { "method": "StartErrorLog", "filename": "ErrorLog", "mailTo": [], "project": "D6" }, { "method": "BuildBakedField", "targetTable": "customer", "overwrite": true, "name": "modified-occupation", "function": "string", "p1": "REPLACE(A,B,C)", "p2": "occupation", "p3": "programmer", "p4": "coder", "project": "D6" }, { "method": "LogChanges", "fromField": "customer.occupation", "toField": "customer.modified-occupation", "project": "D6" } ] ``` Result ```none ErrorLog Start: 2022-02-03 01:10:57 End: 2022-02-03 01:10:58 Errors: Info: LogChanges customer.occupation -> customer.modified-occupation Rows Processed : 14 Rows Changed : 4 Rows Kept : 10 "junior programmer" -> "junior coder" : 1,262,462 "lead programmer" -> "lead coder" : 561,282 "programmer" -> "coder" : 2,735,469 "senior programmer" -> "senior coder" : 1,750,315 ``` ## Advanced Form Multiple replaces can be executed in the same code by changing keys p3 and p4 into arrays of strings. ```json { "method": "BuildBakedField", "targetTable": "customer", "overwrite": true, "name": "modified-occupation", "function": "string", "p1": "REPLACE(A,B,C)", "p2": "occupation", "p3": [ "programmer", "tester" ], "p4": [ "coder", "qa" ], "project": "D6" } ```