Without Parameters.TargetDataStore, the proxy resolves the script context's default data store. Repository errors are converted to script errors. The returned table is mutable in memory; call DataTable.Save only when the intended changes should be persisted.
Column values are available as properties of each row, for example row.Name. Date-time columns are returned as DateTimeOffset values.
// (User.EMailAddress = A OR User.EMailAddress = B) AND User.Disabled != truevarlogons=$Database.Get({TargetSchema:'HR',TargetTable:'UserLogons',Where:{Blocks:[{Criteria:[{Expression:'User.EMailAddress',Value:'[email protected]',Condition:'Or'},{Expression:'User.EMailAddress',Value:'[email protected]'}]}],Criteria:[{Expression:'User.Disabled',Value:true,Comparison:'Different'}]}});
// number of offers per dayvaroffersByDay=$Database.Get({TargetSchema:'Purchasing',TargetTable:'Offers',Columns:[{Name:'Day',Expression:"DateTrunc('Day', OfferDate)"},{Name:'Count',Expression:"Count(DateTrunc('Day', OfferDate))"}],Order:[{Expression:"DateTrunc('Day', OfferDate)",Type:'Ascending'}]});offersByDay.Each(function(){console.info(this.Count+' offers on '+this.Day.toISOString());});