Feilsøking av meldingsflyter
It is always recommended to preview message flows before you save changes or activate them. This guide helps you diagnose and fix issues with dynamic variables.
Problem: Dynamic Variables Do Not Display Correctly
When previewing a message, you may notice that the dynamic variables, such as [UserName]
, are not being replaced with the correct user data. The cause depends on whether a single variable is failing or multiple variables are failing.
Cause 1: A Single Variable Fails
If only one dynamic variable is not working, the issue is most likely a syntax error within the expression itself.
Dynamic variables are expressions enclosed in curly brackets, for example
[UserName]
eller[REFERENCE;DisplayName;UserId;1;[Manager]]
.Carefully check the spelling, syntax, and structure of the failing variable to ensure it is correct.
Cause 2: All or Most Variables Fail
If all or most of the dynamic variables in your template fail to render, the cause is likely invalid code in the message template's HTML source. This often happens when text is copied and pasted from an external application like Microsoft Word, which can insert unsupported formatting tags.
To fix this, you must inspect the HTML source code and remove the invalid tags.
How to Clean the HTML Code
Open the message flow template and switch to the Source Code view.
Look for the following invalid tags:
<span class="code" spellcheck="false">
: This tag should be completely deleted.<p data-pm-slice="1 1 []">
: This tag should be replaced with a standard<p>
tag.
After removing and replacing the invalid tags, save the changes.
Preview the message flow again to confirm that the dynamic variables now display the correct values.
Note: A helpful tip is to copy the entire HTML source code into a text editor like Notepad++ and use its "Find and Replace" function to quickly clean the code.