Skip to main content

Go to Record/Request/Page [ First ]

Loop [ Flush: Always ]

Set Variable [ $buildArray ; Value: List($buildArray;FieldToAddToArray) ]

Go to Record/Request/Page [ Next ; Exit after last: On ]

End Loop

Recently in a project I was working on we were given a to map artwork to a container field in FileMaker. We started by exporting a directory listing. We then imported that into FileMaker to then map the images. This little tip is to help export those directory paths.

In terminal (Mac) navigate to the folder you need to map. Input this code:

find "$PWD" -type f > ~/Desktop/documentPathFile.txt

That will generate a file (and save it to your desktop) you can import into FileMaker.

I have a movie database that I'd like to capture actors from and assign them to the movie. I have JSON data in the array. My goal is to parse it out and create records assigning actors to the movie. Here's some of the steps used to process this:

$array = "{"Actors":"Samuel Ireland, Kylah Day, Melanie Wozniak"}"

Set Variable [ $array ; Value: JSONGetElement (JSON ; "Actors")]

Set Variable [ $count ; Value: ValueCount ( Substitute ( $array ; ", " ; ¶ )

then create a loop in your script and use $count to know how many times you need to loop through the array.

Here was my script (example):

#Set information for actors
Set Variable [ $array; Value:JSONGetElement ( Titles::omdbJSON ; "Actors" ) ]
Set Variable [ $count; Value:ValueCount (
Substitute ( $array ; ", " ; ¶ )
) ]
Set Variable [ $actors; Value:Substitute ( $array ; ", " ; ¶ ) ]
Set Variable [ $movieID; Value:Titles::PrimaryKey ]
#Halt script if array is empty
If [ IsEmpty ( $array ) ]
Halt Script
End If
#Check to see if actor exists if not create actor
Set Variable [ $cnt; Value:1 ]
Loop [ Flush: Always ]
Set Variable [ $temp; Value:GetValue ( $actors ; $cnt

ExecuteSQL ( "

SELECT DISTINCT(a.Name)

FROM Area AS a

INNER JOIN Destination d
ON d."_kf_area" = a."__kp_Area"

INNER JOIN Accommodation accom
ON accom."_kf_Destination" = d."__kp_Destination"

INNER JOIN ItineraryItem ii
ON ii."_kf_Accommodation" = accom."__kp_Accommodation"

INNER JOIN Trip t
ON t."__kp_Trip" = ii."_kf_trip"

WHERE t."__kp_Trip" = ? GROUP BY a.Name

";":" ;" / " ; Trip::__kp_Trip )

Under the field file > manage settings:

Choose field choose "Options"

Choose "Auto-Enter"

Check and Select and "Calculated value"

Press "Specify" and enter "TextFormatRemove ( Self )"

Uncheck the "Do not replace existing value of field (if any)"

Close and save.

You're all done. Formatting will be removed from pasting.