Mobile Workflow Utility Functions

Methods that allow you to access the Mobile Workflow utility functions.

All of the Mobile Workflow utility functions are synchronous.
Method Description
getISODateString(date) Returns a string representation of the specified date (currently in yyyy-mm-dd format only).

date – the specified date.

getLocaleDateString(date) Returns a string representation of the specified date using a locale-specific display.

date – the specified date.

getISODateTimeStringToDisplay(datetime, precision) Returns a string representation of the specified date with the specified precision (currently in yyyy-mm-ddThh, yyyy-mm-ddThh:mm or yyyy-mm-ddThh:mm:ss format only, depending on the precision string (HOURS, MINUTES, SECONDS)).
  • datetime – the specified datetime.
  • precision – (optional) the specified precision, determines the precision used when rounding.
getLocaleDateTimeString(datetime) Returns a string representation of the specified datetime using a locale-specific display.

datetime – the specified datetime.

getISOTimeString(time, precision) Returns a string representation of the specified time with the specified precision (currently in hh, hh:mm, or hh:mm:ss format only, depending on the precision string—HOURS, MINUTES, or SECONDS).
  • time – the specified time.
  • precision – (optional) the specified precision, determines the precision used when rounding.
getLocaleTimeString(time) Returns a string representation of the specified time using a locale-specific display.

time – the specified time.

getTimeStringToDisplayFromStr(datetime, precision) Returns a string representation of the specified datetime string as a time with the specified precision—HOURS, MINUTES, or SECONDS.
  • datetime – the specified datetime.
  • precision – (optional) the specified precision, determines the precision used when rounding.
getDateFromExpression(toolingStr) Returns a date for the specified string, which must be either a string representation of a date or of the form “today” or “today+d” or “today-d”, where d is a number of days.

toolingStr – the date as specified in the Mobile Workflow Forms editor.

parseBoolean(value) Returns true if the specified string is equal, in a case-insensitive way, to true.
parseDateTime(value) Returns a date that corresponds to the specified string.
parseTime(value) Returns a date that corresponds to the specified string.
convertToSUPType(typeAttribute) Returns the XmlWorkflowMessage type for the type attribute value.
  • typeAttribute – the type of the specified HTML element.
getHTMLValue(htmlElement, typeAttribute) Returns a string representation of the specified HTML element’s value.
  • htmlElement – the specified HTML element.
  • typeAttribute – the type of the specified HTML element.
setHTMLValue(htmlElement, value, screenName, adjustForUTC) Sets the value of the specified HTML element from the specified string representation of the value.
  • htmlElement – the specified HTML element.
  • value – the new value.
  • screenName – the screen on which the HTML element appears.
  • adjustForUTC – hardware clock will adjust for coordinated universal time (UTC)
resetHTMLValue(htmlElement, screenName) Resets the value of the specified HTML element.
  • htmlElement – the specified HTML element.
  • screenName – the screen on which the HTML element appears.