Skip to main content
16-Pearl
March 18, 2021
Question

Can we set Scheduler time/CRON dynamically from service TWX 9.1?

  • March 18, 2021
  • 3 replies
  • 2435 views

Hi ,

 

Is it possible to change CRON in Scheduler dynamically? I have Column (DateTime) in Grid. based on This date need to set  CRON in Scheduler.

 

Thanks

3 replies

22-Sapphire I
March 19, 2021

The CRON String should be contained within a configuration table called Settings

So you can use GetConfigurationTable and SetConfigurationTable services to dynamically change it.

It probably requires a RestartThing after you change it.

16-Pearl
March 20, 2021

Hi @PaiChung ,

In SetConfigurationTable. what will be Datashape for Configuration table input? 

 

Thanks

22-Sapphire I
March 22, 2021

Use the Get service to investigate that, although usually there is a datashape matching the or kind of matching the configuration table name. Might be a system object.

Community Manager
April 21, 2021

Hi @VaibhavShinde.

 

If you feel your question has been answered, please mark the appropriate response as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon

17-Peridot
April 11, 2023

Hope this helps,

/** GET SETTINGS **/
var settings = Things["Scheduler_Scheduler"].GetConfigurationTable({
	tableName: "Settings" /* STRING */
});

/** UPDATE SETTINGS **/
settings.schedule = "0 0/9 * * * ?"; //Example
Things["Scheduler_Scheduler"].SetConfigurationTable({
	configurationTable: settings /* INFOTABLE */,
	persistent: true /* BOOLEAN {"defaultValue":true} */,
	tableName: "Settings" /* STRING */
});