PALATINELABSDocsENES

Pages

↑↓ to moveEnter to openEsc to close

Record package guide

Work with one typed row: copy a record, add or remove fields, replace values, and test its headers or cells.

Version 2.17.1. Installed versions can differ. Examples are illustrative and not tested. Packages.

Jump to actions

Prerequisites

Read samples/orders.csv into Table $orders$ (CSV/TXT Open with session=orders, containsHeader=true, delimeter=comma, then Read and Close). Loop over the rows. The first row is $person$, with String fields id=A1, name=Ada, qty=2. Every example starts from it.

id,name,qty
A1,Ada,2
A2,Bea,10

Dictionary fields take a Dictionary variable or JSON such as {"name":"Ana","active":true}.

Shared fields

Typed value inputs

IDFieldType; default; requirementUse
typeStringValValueStringdefault ""optionalIf type is String.
typeNumberValValueNumberdefault 0optionalIf type is Number.
typeBooleanValValueBooleandefault falseoptionalIf type is Boolean.
typeDateTimeValValueDatetimedefault 0001-01-01T00:00:00+00:00optionalIf type is Datetime.

Actions

Add column (recordAddColumn)

Add a named, typed column with a value.

Inputs

Also uses the typed value inputs.

IDFieldType; default; requirementUse
sourceRecordSource record variableRecorddefault empty RecordrequiredBind Record.
columnNameColumn nameStringdefault ""requiredThe new header, for example approved⁠. A header can repeat.
columnTypeColumn typeColumnTypedefault StringoptionalTyped values: String⁠, Number⁠, Boolean⁠, Datetime⁠.
columnInsertPositionInsert column atColumnInsertPositiondefault LastoptionalFirst to prepend, Last to append, or Specific to use specificPosition⁠.
specificPositionspecificPositionNumberdefault 0optionalFor Specific⁠, a column number from 0 up to and including the number of columns.

Outputs

IDTypeResult / editor field
destinationRecordRecordRecord with the new typed column at the chosen place. Field: Destination record variable⁠.

Example

Use $person$ from Prerequisites. Set sourceRecord=$person$, columnName=approved, columnType=Boolean, typeBooleanVal=true, columnInsertPosition=Last. Bind destinationRecord to $approvedPerson$.

Expected result

$approvedPerson$ has fields id=A1, name=Ada, qty=2, and Boolean approved=true. A Specific number outside 0 to the number of columns fails.

Back to actions

Assign (recordAssign)

Pass the Record to a later step with the same columns and values.

Inputs

IDFieldType; default; requirementUse
sourceRecordSelect the source record variableRecorddefault empty RecordrequiredBind Record.

Outputs

IDTypeResult / editor field
destinationRecordRecordThe source Record, same columns and values. Field: Select the destination record variable⁠.

Example

Set sourceRecord=$person$. Bind destinationRecord to $personCopy$.

Expected result

$personCopy$ has the same id,name,qty columns and A1,Ada,2 values. An empty Record stays empty. Assign returns the source Record, not a new copy.

Back to actions

Delete column (recordDeleteColumn)

Remove a column and its value by name or number.

Inputs

IDFieldType; default; requirementUse
sourceRecordSource record variableRecorddefault empty RecordrequiredBind Record.
deleteColumnByDelete column byColumnBydefault IndexoptionalIndex or Name⁠. See column selection.
columnIndexColumn indexNumberdefault 0optionalColumn index.
columnNameColumn nameStringdefault ""optionalIf Name⁠. See column selection.

Outputs

IDTypeResult / editor field
destinationRecordRecordRecord without selected column and value. Field: Destination record variable⁠.

Example

Set sourceRecord=$person$, deleteColumnBy=Name, columnName=qty. Bind destinationRecord to $identity$.

Expected result

$identity$ contains only id=A1 and name=Ada. A missing column or a bad number fails, also on an empty Record.

Back to actions

Set record (recordSet)

Set named fields from a Dictionary, with its values and types. It can add missing fields.

Inputs

IDFieldType; default; requirementUse
rowRecordTemplate recordRecorddefault empty RecordrequiredBind Record.
listAdd required column name and corresponding valueDictionarydefault {}requiredBind a Dictionary or enter {"name":"Ana","active":true}⁠. Keys are headers; values give the new values and their types.
bAddIfMissingAdd column, if does not exist alreadyBooleandefault falseoptionaltrue adds missing headers at the end. false⁠: a key with no matching column fails.
caseSensitiveCase-sensitive header matchingBooleandefault falseoptionalCase comparison.

Outputs

IDTypeResult / editor field
resultRecordUpdated Record, with missing fields added at the end if allowed. Field: Assign modified record to⁠.

Example

Set rowRecord=$person$, list={"name":"Ana","active":true}, bAddIfMissing=true, caseSensitive=false. Bind result to $changedPerson$.

Expected result

The result keeps id=A1 and qty=2, replaces name with String Ana, and appends Boolean active=true. With bAddIfMissing=false, the missing active fails. An empty Dictionary changes nothing, except that a column with no value gets an empty String.

Back to actions

Update cell (recordUpdateCell)

Replace one cell; the column takes the type of the new value.

Inputs

IDFieldType; default; requirementUse
inputRecordBase recordRecorddefault empty RecordrequiredBind Record.
selectMethodSelect column bySelectBydefault NAMEoptionalNAME or INDEX⁠. See column selection.
colNameColumn nameStringdefault ""optionalSelected name.
caseSensitiveCase-sensitive comparisonBooleandefault falseoptionalCase comparison.
colIndexColumn indexNumberdefault 0optionalColumn index.
newValueNew value of cellAnydefault empty StringoptionalBind a typed variable, for example String $replacement$ with Ana⁠. The column takes its type. Text entered directly gives type Any.

Outputs

IDTypeResult / editor field
resultRecordRecord with the new value and the new column type. Field: Assign modified record to⁠.

Example

Create String $replacement$ with value Ana. Set inputRecord=$person$, selectMethod=NAME, colName=name, caseSensitive=false, newValue=$replacement$. Bind result to $correctedPerson$.

Expected result

The result has id=A1, String name=Ana, and qty=2. An unknown header or a bad number fails.

Back to actions

Update column (recordUpdateColumn)

Replace a column's type and value; keep its name.

Inputs

Also uses the typed value inputs.

IDFieldType; default; requirementUse
sourceRecordSource record variableRecorddefault empty RecordrequiredBind Record.
updateColumnByUpdate column byColumnBydefault IndexoptionalIndex or Name⁠. See column selection.
columnIndexColumn indexNumberdefault 0optionalColumn index.
columnNameColumn nameStringdefault ""optionalIf Name⁠. See column selection.
columnTypeColumn typeColumnTypedefault StringoptionalTyped values: String⁠, Number⁠, Boolean⁠, Datetime⁠.

Outputs

IDTypeResult / editor field
destinationRecordRecordRecord with the new type and value; names kept. Field: Destination record variable⁠.

Example

Set sourceRecord=$person$, updateColumnBy=Name, columnName=qty, columnType=Number, typeNumberVal=3. Bind destinationRecord to $recounted$.

Expected result

$recounted$ keeps id and name; qty now has type Number and value 3. The old value is replaced, not converted. A missing column or a bad number fails.

Back to actions

Conditions

Record cells are blank (recordBlank)

True if every value is empty or only white space. Column names do not count.

Inputs

IDFieldType; default; requirementUse
rowRecordInput Record variableRecorddefault empty RecordrequiredBind Record.

Outputs

No output. True or false picks the branch.

Example

Set rowRecord=$person$. For a true case, make a Record with two String cells: one empty, one with only spaces.

Expected result

$person$ gives false because it holds A1, Ada and 2. The blank sample gives true. A Record with no values also gives true. Number 0 and Boolean false are not blank.

Back to conditions

Record has column (recordHasColumn)

Check a header before updating a field by name.

Inputs

IDFieldType; default; requirementUse
inputRecordRecordRecorddefault empty RecordrequiredBind Record.
conditiontypeConditionContainsConditiondefault CONTAINSoptionalCONTAINS (editor: Includes) needs the named header. NOTCONTAINS (editor: Does not include) gives the opposite.
colNameColumn headerStringdefault ""requiredThe header to test, for example name⁠. A missing header gives false for Includes, not an error.
caseSensitiveCase-sensitive comparisonBooleandefault falseoptionalCase comparison.

Outputs

No output. True or false picks the branch.

Example

Set inputRecord=$person$, conditiontype=CONTAINS, colName=name, caseSensitive=true.

Expected result

The condition is true. colName=Name gives false with case-sensitive matching. NOTCONTAINS gives the opposite. An empty Record has no matching header.

Back to conditions

Record headers are blank (recordSchemaBlank)

Test if all headers are blank, or if any is not. Values do not count.

Inputs

IDFieldType; default; requirementUse
inputRecordInput Record variableRecorddefault empty RecordrequiredBind Record.
conditiontypeCondition to checkBlankHeadersdefault ALL_HEADERS_BLANKoptionalALL_HEADERS_BLANK needs every name to be empty or only white space. ANY_HEADER_NOT_BLANK is the opposite.

Outputs

No output. True or false picks the branch.

Example

Set inputRecord=$person$, conditiontype=ALL_HEADERS_BLANK.

Expected result

The condition is false for headers id,name,qty; ANY_HEADER_NOT_BLANK gives true. A Record with no columns gives true for all blank and false for any not blank.

Back to conditions