This page contains some example code to use javascript within SSP
Adding Timeslots to datastore
Storing PowerShell results in datastore
Filtering on JSON array