Retrieve value list from a Filemaker layout using Filemaker API

We know we can get value list from a layout with help of getValueList() method. But it has a drawback, let me explain it here:

-This method returns value list in an array from the first field. It does not bother about whether second field is associted with the value list or not.

-And also it will be deprecated. So use getValueListTwoFields() to get a value list.

getValueListTwoFields():

The method getValueListTwoFields() also returns an array. The returned array is an associative array that contains the displayed values from the second field of the value list as the keys, and the associated stored values from the first field as the array values.

The array values are always from the first field, but the values in array keys depends on the options selected in the specify fields for Value List dialog box in the FileMaker database.

i. If ‘Also display values from second field‘ is not selected, then the returned array will contain only the values from first field as both array keys and array values.

ii. If both ‘Also display values from second field‘ and ‘Show values only from second field‘ are selected, then the returned array will contain values from first field as array values and values from second field as array keys.

iii. If ‘Also display values from second field‘ is selected and ‘Show values only from second field‘ is not selected,then the returned array will contain values from first field as array values, and values from both first and second field as array keys.

iv. If the value list contain custom values, then the returned array will contain these custom values as both array keys and array values.

150 150 Burnignorance | Where Minds Meet And Sparks Fly!