--- title: "system.opchda.insertReplace" description: "Will insert values on the OPC-HDA server, or replace them if they already exist." --- # system.opchda.insertReplace > Will insert values on the OPC-HDA server, or replace them if they already exist. This function is used in **Python Scripting**. ## Description ## Client Permission Restrictions [Permission Type](../../../ignition-modules/vision/vision-project-properties/vision-project-properties.md#vision-permissions-properties): OPC Server Management Client access to this scripting function is blocked to users that do not meet the role/zone requirements for the above permission type. This function is unaffected when run in the Gateway scope. ## Syntax `system.opchda.insertReplace(serverName, itemId, value, date, quality)` ### Parameters Type | Parameter | Description ------- | ------- | ------ String| `serverName` | The name of the defined OPC-HDA server. String| `itemId` | The item ID to perform the operation on. Object| `value` | The value to insert or replace. Object| `date` | The date to insert or replace. QualityCode| `quality` | The quality to insert or replace. ### Returns **QualityCode** - The result of the insert or replace operation. See [Scripting Object Reference](../../reference-pages/scripting-object-reference/scripting-object-reference.md#qualitycode). ### Scope Gateway, Vision Client, Perspective Session ## Code Examples ```python title="Example #1" # This example will insert a new date for a specific entry on an OPC HDA server. # Declare a date to insert start = system.date.getDate(2022, 10, 25) # Call the system function hda = system.opchda.insertReplace('Matrikon HDA','1',3,start,1) # Print out various attributes print hda.isError() print hda.getCode() print hda.isBad() print hda.isGood() ```