Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Add Array into Filemaker Text field

Featured Replies

Hi All,

How can insert an array into a field? Is this possible?

Or if not, How can I insert the array's data into the filemaker field?

thanks

RB

  • 3 weeks later...

Hi WingMaker,

1) Depends on the complexity of the array.

2) Depends if you want it to be human readable or are just using it for storage purposes.

If you just wanted to store the array values for example to be used again later:

1) To Store


$array = array("Item 1","Item 2","Item 3");

$storeArray = implode("n",$array);

.

.

.

$myEditCmd->setField('array',$storeArray);

$myExitCmd->execute();





2) To Retrieve



$storeArray = $record->getField('array');

$array = explode("n",$storeArray);







If you had a more complicated array and wanted to store it and retrieve it the easiest way would be as follows:



$array = array(

51255=>array("FirstName"=>"Alex","LastName"=>"Babkov","CallSign"=>"Alex Babkov"),

99124=>array("FirstName"=>"Bob","LastName"=>"Hawke","CallSign"=>"Primey")

);

$storeArray = base64_encode(serialize($array));





And to retrieve:



$storeArray = $record->getField('array');

$array = unserialize(base64_decode($storeArray));

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.