URI /RESTfm/{database}/script/{script}/{layout}

Executes {script} in the context of {database} and {layout}.

Every script must specify a layout for context.

Returns a list of records from the script's found set. If the script does not produce a found set, a single random record is always returned from {layout}.

Optional query string parameters

RFMscriptParam=<string> URL encoded parameter string to pass to script.

Example FileMaker script, URI and Response

SimpleSearch FileMaker Script

1
2
3
4
5
6
Enter Find Mode [ ]
Set Field [ postcodes::Pcode; Get ( ScriptParameter ) ]
Perform Find [ ]
If [ Get ( FoundCount ) > 0 ]
    Exit Script [ Result: Get ( FoundCount ) ]
End If
Example 'SimpleSearch' FileMaker script.

Script URI - JSON - GET - Execute

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{
    "data": [
        {
            "Pcode": "7300",
            "Locality": "DEVON HILLS",
            "State": "TAS",
            "Comments": ""
        },
        {
            "Pcode": "7300",
            "Locality": "PERTH",
            "State": "TAS",
            "Comments": ""
        },
        {
            "Pcode": "7300",
            "Locality": "POWRANNA",
            "State": "TAS",
            "Comments": ""
        }
    ],
    "meta": [
        {
            "recordID": "5900630",
            "href": null
        },
        {
            "recordID": "5900631",
            "href": null
        },
        {
            "recordID": "5900632",
            "href": null
        }
    ],
    "info": {
        "X-RESTfm-Version": "2.0.1\/r280",
        "X-RESTfm-Protocol": "4",
        "X-RESTfm-Status": 200,
        "X-RESTfm-Reason": "OK",
        "X-RESTfm-Method": "GET"
    }
}
Example 'SimpleSearch' script execution, with parameter, and response.

Changelog

Version Description
1.1.0 Script parameter querystring changed to RFMscriptParam
1.0.0 Script parameter querystring was RFMparam