Welcome to Catalog Tips

Search more than 200 articles to learn more about creating and automating your product catalogs

Tip: Start typing in the input box for immediate search results.

< All Topics
Print

XREFFIELD – Return value of field from another record

Overview

This Custom Field searches the data source for a record whose field content matches a given value, and will return the value of another field for the found record. It returns the first instance found.

Syntax

XREFFIELD(‘SearchField‘,SearchValue,ReturnField,DataSource)

XREFFIELD(‘PartNo‘,FIELDSTR(‘XRefPartNo’),’Page‘)

Element String
SearchField The name of the field to search in.
SearchValue The value to search for in the ‘Search Field’
ReturnField The name of the field to return from the matching record.
DataSource The name of another EasyCatalog data source to search within. This option applies to the Search Field and Return Field parameters; the Search Value will be retrieved from fields in the current data source. This is an optional element.

Example

XREFFIELD(‘PartNo‘,FIELDSTR(‘XRefPartNo’),’Page‘,Parts.txt)

This example will search for a record whose ‘PartNo‘ field contains the value of this record’s ‘XRefPartNo‘ field. When one is found, the contents of its ‘Page‘ field will be returned.

PartDescriptions.txt

XRefPartNo Description Page
A1 Door handle 1
B1 Hinge 1
B2 Phillips Head Screw 2

Parts.txt

PartNo Page
A1 1
B1 1
B2 2

See also

Table of Contents