Home Search

DriveWorks Pro 22
SppReplaceInTable

Send Feedback

SppReplaceInTable

Returns a Table Array with matching search items replaced with a new value in the given column.

Syntax

SppReplaceInTable ([Table Array],[Column],[Search Text],[Replace Text],[Exact Match])

Where:

Table Array is a Table Array such as the data in a standard Table or the result of the QueryDataValues Function.

Column is the column on which to set the value. A number starting at 1 for the first column.

Search Text is the text to look for in the specified column.

Replace Text is the text to replace for each row where the search text is found in the specified column.

Exact Match is TRUE to only replace where there is an exact match, FALSE to replace if the search text is contained in the Table value.

Example

RuleResultMeaning
SppReplaceInTable(DWLookupCustomers,4,"Charlotte","Denver",TRUE){"First Name","Second Name","Country","City"; "Frank","Johnson","USA","Denver";"Jack","Jones","United Kingdom","Swansea";"Laura","Hughes","United Kingdom","Leeds";"Trent","Davids","Canada","Toronto"}Will return a Table Array showing the data but with the replacement made.

Example Data

FirstNameSecondNameCountryCity
FrankJohnsonUSACharlotte
JackJonesUnited KingdomSwansea
LauraHughesUnited KingdomLeeds
TentDavidsCanadaToronto