Variable not resolving, variable in rule not working, variable shows null value, variable shows blank value
setting variable in rule, variable not getting set
First thing you want to do is go to the rule target in question and execute the "Show Rules" command (right click option in the cell the rule is running against) and this will display the rule logic. This will help determine which of the below problems you are seeing.
- Root Cause 1 - The rule block has a local variable defined like the one below, and the user notices the variable is not resolving to the correct value, or no value when hovering over variable name, or when looking at the path alias matching value.
set $(variablename) path "aliasName" value
- Root Cause 2- The rule block has a userdata variable that's grabbing the value from a local variable as seen below, and user notices the variable is resolving to blank, zero, or the wrong value.
userdata "example_userdata" $(variablename)
- Root Cause 1 & 2 - The xpath of the path alias was not set up correctly and is causing the wrong value or no value to be picked up.
- Root Cause 2 - The local variable being referenced by the userdata variable does not exist or has a misspelling in the name.
- Solution Root Cause 1 & 2 - If the path alias referenced by the local variable is using a relative xpath do the following
- Go back to your rule and copy the target Xpath
- Go to the Advanced tab of the rule and click the Edit button next to the xpath of the path alias referenced by the local variable
- In the "Evaluate path relative to" field paste the target Xpath
- Click the "Evaluate path" button and confirm the relative path alias is able to pick up the desired value.
- If you notice the Xpath is not picking up any matches, you must go back and reconfigure the Xpath and test out the revised Xpath using the "Evaluate Path" button. If you are still having trouble getting the Xpath to work, please check out the Relative Paths section of the XPaths guide here as a reference, further reading can also be found here.
- Solution Root Cause 2 - The Gateway Setup Editor will not let you know if the local variable defined does not exist. So you want to make sure to go back to the rule and double check the variable name is the same across the rule block if it's referenced multiple times. We recommend copying the rule block and pasting it to a text editor and search for the variable name in question just to make sure it comes up everywhere you defined it. Should you notice the variable was misspelled go back and fix the typo and test our your rule again.
If Issue Persists
- Please contact with our Client Services team via the chat service box available in any of our websites or via email to email@example.com
- Make sure you provide to us:
- A description of what the rule is supposed to do, what the issue is, and the variable you believe is causing the issue.
- A screenshot of the dataview with the rule in question
- A full screenshot of the "Show Rules" command output
- XML of the rule that has the issue