Expand my Community achievements bar.

Data element not setting latest value

Avatar

Level 2

Hi all,

 

Need your help for an issue I am facing with data element not setting the latest value passed from the application, when used in multiple rules and those multiple rule firing at the same time. 

 

It seems a timing issue, but I have set the "Storage duration" to None.

 

The data element is returning the older value. It should send us the latest updated value.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

3 Replies

Avatar

Level 8

@koolswap - Are you triggering direct call rules, by chance? If so, maybe consider passing the data in as part of the event payload. That way, when you execute the rule, you're looking at the exact data you need and not having to wait for other logic to execute.

For example, let's say you have a direct call rule that you call "do-that-thing" and you want to pass in a color specific to each time it is called. To make this work, you'd make the following call:

_satellite.track("do-that-thing", { color: "blue" });

The second parameter of the .track() call must be an object, and you can pass in whatever properties you need. The entire payload/object will be accessible inside the direct call rule as "event.detail". Any properties (eg// color) can be accessed by their names, for example:  %event.detail.color%

This approach can be used to populate variables (props/eVars/etc), inform conditional logic, etc, and the value is specific to each time the direct call rule is invoked.

Avatar

Community Advisor

There could be a race condition in your Rule vs the data element getting updated.

E.g.:

  1. User performs the action that triggers the Rule.
  2. The Rule runs.
  3. The Rule gets the values from the data elements.
  4. The web page code runs to update the data elements.
  5. The Rule's action runs.

In the above scenario, the data elements got updated only after the Rule had executed at step 3. As a result, the Rule only knows of the old data element values, not the new ones that were set at step 4.

Avatar

Level 10
Do any of the answers below answer your initial question? If so, can you select one of them as the correct answer? If none of the answers already provided answer your question, can you provide additional information to better help the community solve your question?