ph_setglobal_a PowerHome formula function
Description
Sets the value of a global variable with any type of data.
Syntax
ph_setglobal_a ( id, value )
Argument Description
id A string identifying the ID of the global variable to set.
value Data of type any which you would like assigned to the specified global variable.
Return value
Integer. Returns a 0 if successful and a 1 if an error occurred while updating the global variable. You can pass any data type as the a argument.

All global variables are stored internally as strings and will be converted. Numeric values will be converted as is. Date values will have a mask of ‘yyyy-mm-dd’ applied. Datetime values will have a mask of ‘yyyy-mm-dd hh:mm:ss.fff’ applied. String values must be contained in quotes and go over without conversion.

Any other data type will just be converted as is to a string and then stored.
Examples
The following examples demonstrate typical syntax/usage for this function.
• ph_setglobal_a("ALERT_SMS2",0)
• ph_setglobal_a("MODE","Heat")