RecordCopier Python Class

Version:
Current
Last modified: June 15, 2020

The RecordCopier class provides a system for managing and duplicating new records based off an existing record. RecordRef represents a reference to a record’s underlying data, and can be accessed & manipulated via the RecordCopier class.

Methods

_init_

Instantiates a new instance of the RecordCopier class.

Python
  1. __init__((RecordInfo)destination, (RecordInfo)source,
  2.      (bool)suppress_size_only_conversion_errors=False,
  3.      (str)decimal_separator='.') -> None :
  • destination: The RecordInfo object that represents the connection to which the data is copied.
  • source: The RecordInfo object that represents the connection from which the data is copied.
  • suppress_size_only_conversion_errors: An option to suppress errors that occur during data conversion when the destination field size is too small.
  • decimal_separator: An option that sets the decimal separator when making string-to-number or number-to-string conversions. The option can be set to equal '.' or ','.

add

Adds a field index mapping to the list of field mappings stored by RecordCopier by specifying the destination and source field indexes.

Python
  1. add((int)destination_field_num, (int)source_field_num) -> None :
  • destination_field_num: The zero-based index of the field in the destination RecordInfo object.
  • source_field_num: The zero-based index of the field in the source RecordInfo object.

Call RecordCopier.DoneAdding when you are finished adding field mappings.

copy

Copies the contents of the source RecordRef into the destination RecordCreator based upon the RecordCopier's field mapping. The field mappings must match between the RecordRef and the destination RecordCreator.

Python
  1. copy((RecordCreator)destination, (RecordRef)source) -> None :

RecordCopier.DoneAdding must be called before this function to achieve a successful copy.

done_adding

Notifies the RecordCopier that have been added.

Python
  1. done_adding() -> None :

set_dest_to_null

Sets the field values for the destination RecordCreator to [Null].

Python
  1. set_dest_to_null((RecordCreator)destination) -> None :
Was This Helpful?

Running into problems or issues with your Alteryx product? Visit the Alteryx Community or contact support.