Many widgets come with the ability to click on one part of it or select a choice. For example, this date picker allows a user to choose a date and time range. That is a great use of the interface widget.
But the widget would be worthless if the date range could not be used in FileMaker scripts.
As a widget user, you don't need to know about that, though. All you need to know is the Widget Customization options that send the data back.
What you need to know
All you need to worry about are three things:
The name of the script that will run to take the data from the widget into FileMaker
This script's name can be a data option, and it can be generated in the script or calculation.
While testing in WidgetStudio, the name "Test" can be entered. This will run a script in WidgetStudio called Test and show you the Script Parameter.
The name of the file that contains the script.
The name of the file can be hardcoded, selected from among the open database files, or calculated using the Get (FileName) function
While testing in WidgetStudio, select "WidgetStudio" so you can run the Test script there.
The Script Parameter
Data from the widget gets pushed to FileMaker as a script parameter. So you need to know about that.
inside the button with the Script Icon next to the script name, the author of the widget has clarified the JSON object that will be returned. In the case of the date picker, the start and end key/value pairs are returned to FileMaker.
You can also see the parameter returned to FileMaker when running the script inside WidgetStudio.
Creating the Script to Parse the object
WidgetStudio provides a fast way to create the script that will parse the object.
Clicking on the script icon at the top-right of the Script Parameter window will copy script steps to the clipboard so you can paste them into a new script.