GetJsonArrayS
Back to ListDescription: ACF function: get an array from a JSON object into an regular array.
FileMaker Prototype:
Set Variable [$res; ACF_Run("GetJsonArrayS"; JSON_j; string_tag)]
Category: UTILITY
Function source:
// Fun ction: GetJsonArrayS
// Description: Extracts a JSON array into a regular array of strings.
// Parameters:
// - j: A JSON object that contains the target array.
// - tag: The key (string) associated with the JSON array to retrieve.
// Returns:
// - An array of strings containing the values from the specified JSON array.
function GetJsonArrayS(JSON j, string tag)
array string res; // Initialize the result array
int i, x;
// Get the size of the JSON array associated with the given tag
x = sizeof(j[tag]);
// Iterate through the JSON array and retrieve each value as a string
for (i = 1, x)
// Format the JSON key to access array elements (e.g., "tag[1]", "tag[2]")
res[] = j[format("%s[%d]", tag, i)];
end for
// Return the populated array of strings
return res;
end