FM Variables, JSON Property Names, and JS Variables, oh My!

As developers in both FileMaker and JavaScript we have a lot to keep track of. Not only do we have to keep two platform’s separate syntaxes in our heads, but we are also flowing data through tables, scripts, variables, functions, parameters, and prep for use in the JS. There’s a lot.

One way that I’ve found to be useful is keeping an FM variable name, a JSON property name, and the JS Variables the same.

Look at these images to see how the “line” value set in FileMaker traces through the code.



It is easy to keep track of values when the variables are the same (and, for JS, the case of the variable is the same).

I usually start my variable creation in JS. I do that becaues JS is more strict on how the variable is named. Once I get that established, I then bring the variable name of a particular value into the script steps, and I use that same variable name for the JSON property.


It’s simple to do once you get the hang of it, and you can trace data a lot better when then the value you’re trying to use is in different variables or properties.