Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
joe_warbington
Luminary Alumni
Luminary Alumni

Comparing previous value to newly updated values in Automations - not working consistently

I have an automation that I've been adding to that basically looks at a Measure value prior to reload, then does a reload, then compares that original value to the new value, and if the value has grown it will send a message to Slack.

I haven't been able to get it to compare successfully, but my logic seems correct. 

The original (pre-Reload) value is always available in the output, but the after reload value isn't read fully and sometimes it errors out. What do I need to do? Add in a sleep block before/after reading the value again?

Here's the layout: 

joe_warbington_0-1641505686828.png

 

The condition is: 

joe_warbington_1-1641505730328.png

 

The history usually looks like this with the argument 2 supposed to reflect the after reloaded value:

joe_warbington_2-1641505775051.png

 

Sometimes it errors out with "error: Client read timeout". 

Though most times the condition is not met because the new value isn't retrieved. It says it's NULL but that is impossible as it's a growing value. Hints on how to troubleshoot this?

 

Labels (1)
3 Replies
joe_warbington
Luminary Alumni
Luminary Alumni
Author

On the Chronological view, I can see that the block for Get Measure Value doesn't work as expected. It just returns some ID instead of the value. Get Measure Value 3 (and the original 4) do work though... Hmmm....

joe_warbington_0-1641506045896.png

 

joe_warbington_2-1641506070618.png

 

AfeefaTk
Support
Support

Hi @joe_warbington 

I am not able to pinpoint the issue here

In order to investigate further, Could you please share the JSON export of your automation (right-click in the editor - download workspace)? 

Thanks!

Afeefa TK

Emile_Koslowski
Employee
Employee

Hi all,

First some background info on the blocks:

  • the Get Measure Value block interacts with your app through an engine session
  • the Do Reload and Get App Information blocks are made through a REST API

Performing a reload will trigger a data refresh in all active sessions. I believe that the sessions can not communicate with the engine while data is refreshed.

The following steps explain how the session is handled in this automation:

  1. The first Get Measure Value block will start a session and retrieve the measure value. This session stays open for the duration of the automation.
  2. The Do Reload block will trigger a data refresh in all active sessions, including the current session in the automation.
  3. After the reload it takes some time before the session is available again.

Could you verify the above by adding a Sleep block after the Do Reload block? You might need to adjust the time a bit to get it right.

Also, those Get Measure Value blocks don't return a random ID, they return nothing and have no output. What you see under the blocks preview in the chronological view for those blocks is the app id. I'll see if we can make a change to this Preview field to show nothing when there's no output.

Kind regards,

Emile