How to automatically set a property value to the current date/time.

How to automatically set a property value to the current date/time.

book

Article ID: KB0079915

calendar_today

Updated On:

Products Versions
Spotfire Analyst All Versions

Description

It is useful to have a property (document, data table, column) that is updated with the current date/time when the report is opened. One way this can be accomplished is by using a data function to update the property when the report is opened.
 

Issue/Introduction

How to automatically set a property value to the current date/time.

Resolution

Create a data function that outputs the system time to a document property. For example, a document property named 'CurrentDateTimeProperty'. This data function will execute automatically when the report is opened and updating the property value.

 

The data function can be created here:

  1. Edit > Data Function Properties > Register New...

See the reference How to Use Data Functions for the detailed description of creating and managing data functions

Data Function Details:

Name: Update_CurrentDateTimeProperty

Script:
output <- Sys.time()
Output parameter:
  - Name: output
  - Type: Value

  - Output: Document property:CurrentDateTimeProperty

 

 

Requirements:

Since this uses a data function as the trigger, this requires a statistics engine to work. TERR is included in the Professional/Analyst/Desktop Client, so there are no additional requirements for this to work in those clients. For this to work on Web Player, you need to configure Spotfire to point to a TIBCO Spotfire Statistics Services (TSSS) server instance. This TSSS URL must be configured here according to the Configuring TIBCO Spotfire to use TIBCO Spotfire Statistics Services reference.

 

Example:

See the attached (Filename: Automatically set property to current date time.dxp). Requires Spotfire version 6.5 or higher.

Additional Information

Doc: How to Use Data Functions

Doc: Configuring TIBCO Spotfire to use TIBCO Spotfire Statistics Services

Attachments

How to automatically set a property value to the current date/time. get_app