JayFF
Posts: 119
Joined: Fri Oct 03, 2014 1:03 am
Location: USA
Contact: Website

RE: GUIDE: Script Notifiers

Wed Dec 02, 2015 10:35 pm

Hi All,

Is it possible to use a script notifier to add a report argument? I need to modify a raw value coming in from the device to a processed human friendly value and then add the human friendly value as a report argument.

Thanks,
Jay

J. F. Florey

User avatar
johan
GpsGate
Posts: 14958
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

RE: GUIDE: Script Notifiers

Wed Dec 02, 2015 10:47 pm

Script Notifier - No.

Suggested solution #1

Use a Device Mapper Script to decode your cryptic data to a human readable string variable, which you include as Report Argument.

More info: http://gpsgate.com/blogComment/device_mapper_scripting

Suggested solution #2

Use a Script Expression and define variables in the script which you use in your Report Argument.

More info:
Set Notifier variables from script. topic.asp?TOPIC_ID=17167
Script Expression: http://gpsgate.com/blogComment/script_expressions

Regards,
Johan

GpsGate Support

JayFF
Posts: 119
Joined: Fri Oct 03, 2014 1:03 am
Location: USA
Contact: Website

RE: GUIDE: Script Notifiers

Wed Dec 02, 2015 10:49 pm

Hi Johan,

Thank you for the prompt response. I will look into your suggested solutions.

Cheers,
Jay

husky92
Posts: 362
Joined: Wed Mar 31, 2010 2:08 am
Location: Norway

RE: GUIDE: Script Notifiers

Mon Mar 07, 2016 9:31 pm

Hi!

Can Script notifiers be used to dynamically select notification recipients of SMS notifications?

If not, Is there any other way of dynamically select recipients of notifications?

What is the "Notifier group" field, and can it be utilized for the dynamic selection of notifiers for SMS notifications?

Thank you!

User avatar
Mattias
GpsGate
Posts: 135
Joined: Wed Dec 16, 2009 3:59 pm
Location: Sweden

RE: GUIDE: Script Notifiers

Tue Mar 08, 2016 1:07 pm

Hi,

Notifier Group can only be used from Script Expressions. See context.startEvent() in the Script Editor.
An example:

Code: Select all

var speed = trackPoint.velocity.groundSpeed;

if (speed < 10) {
  context.startEvent('speedEvent', 'group1');
}
else if (speed > 20) {
  context.startEvent('speedEvent', 'group2');
}
else {
  context.endEvent('speedEvent');
}

return false;
This will only call notifiers with group="group1" if speed is less than 10. And only notifiers with group="group2" if speed is greater than 20. See the following topic for more script expression tips: topic.asp?TOPIC_ID=18303

So, if you rewrite your event rule to use a script expression you can have different SMS notifiers for different people, and then depending on why your event turns true you can call only the notifier you want.

Regards,
Mattias

Return to “GpsGate for Developers”