AnsweredAssumed Answered

Get(ScriptResult) returns old result if recent script returns nothing

Question asked by travispressestheredbutton on Feb 27, 2015
Latest reply on Oct 4, 2016 by justinc

Summary

Get(ScriptResult) returns old result if recent script returns nothing

Product

FileMaker Pro

Version

13

Operating system version

Mac

Description of the issue

Get(ScriptResult) description is "Use this function as part of a calculation evaluated within a script. If a subscript doesn’t return a result, then the content of the script result will be empty."

But if a script exists with no value then Get(ScriptResult) is returning the value of the next previously run script.

Steps to reproduce the problem

I created four scripts. The first three just contained the script "Exit Script". One exited with an empty value. The next returned "Hello Test". Finally the third returned "Goodbye Test". The last script ran them and tested the returned value from Get(ScriptResult) in order: No Result; Hello Test; No Result; Goodbye Test; No Result

Expected result

No Result: Empty;
Hello Test: "Hello Test";
No Result: Empty;
Goodbye Test: "Goodbye Test";
No Result: Empty;

Actual result

Calling script with no result
Success - script returned ""
======================
Calling script expecting "Hello Test"
Success - script returned "Hello Test"
======================
Calling script with no result
Failure - script returned "Hello Test"
======================
Calling script expecting "Goodbye Test"
Success - script returned "Goodbye Test"
======================
Calling script with no result
Failure - script returned "Goodbye Test"

Workaround

I have to call Exit Script with "" to ensure it returns nothing.

Outcomes