I created a form to get customer input and based on the input generate a output “CME Validation Error”. Would you happen to know if I can have each variable in a new line and if that variable is null not to show in the output. Below is an image of the form and the variables I am assigning to the output variable.
Assigned the below to an single variable then tied that to an argument going into the form.
noMatchCaseNumber + VbNewLine+
noMatchFirstName + VbNewLine+
noMatchLastName + VbNewLine+
noMatchBodyStatus
I like Environment.NewLine, much easier to read (and remember). vbcrlf is outdated, I would say. There is also a stackoverflow post about why Environment.NewLine is more preferrable.
@syi
the argument is of type in/out
the l-Value exception is thrown as it is excpecting a clear destination where to store the value
it should be get fixed by
changing the direction to only out
to define a variable, get initialized with the different matchresult values and new lines (as you have done in the screenshot) and using this newly created variable for the in/out argument
Hi @syi
That is to be expected. Here’s a revision of the basic differences in directions and when you might use what:
IN - If you want to send a value TO the form, either to display or use for some calculations.
If you end up changing the value, it won’t reflect into your main workflow once the form is submitted. It only goes one way - inward
OUT - The exact opposite, a value that your form gives back to the workflow, but it may not exist before calling the form. The easiest example is any user input - you present an empty field and whatever user enters/selects - is the OUTPUT from your form.
Only outward
IN/OUT - This is when you want to send a value in but also expect to know about any changes to its value during the course of the form execution.
An example could be that you’re getting an OCR extracted data validated from a user through a form. You present what the bot was able to capture and get the user to correct it if necessary.
The output will reflect into your workflow when the direction is two-way.
Now what @ppr and @ui_xpath are saying is that when setting direction to IN/OUT, it needs to be a SINGLE variable in the field. Referring to the explanation of IN/OUT above, because you want to read back whatever was changed, it should be ONE variable where the workflow will store it for further use.
In your screenshot above, continue to use IN/OUT if you need, just use a single variable that represents ‘matchValidationError’ variable, instead of the constructed string of 3 variables
Hello
Thank you for the explanation it was very helpful.
What I still don’t get is why the output to FORM shows everything on a single line where the output to MESSAGE BOX will create new line where Environment.NewLine is used.
So when I assign:
var1 + Environment.NewLine +
var2 + Environment.NewLine+
var3 + Environment.NewLine +
var4
to varTotal
in FORMS varTotal shows as:
var1 var2 var3 var4
in MESSAGE BOX varTotal shows as:
var1
var2
var3
var4
Not sure what I am missing where FORMS is ignoring the Environment.Newline command.
It turns out that it doesn’t matter if you use Environment.NewLine or \n. To get the line breaks rendered correctly, don’t disable the Text Area component. But how do I prevent the user from entering text in that area? Edit the JSON and add the readonly attribute instead.