Syntax for error message with a variable? | Community
Skip to main content
LukasPe1
May 9, 2022
Solved

Syntax for error message with a variable?

  • May 9, 2022
  • 1 reply
  • 1072 views

Is it possible to insert a variable in an error message in input forms? Non working sample code for illustration:

<check expr="[/tmp/@validationResult] == ''"> <error>$([/tmp/@validationResult)</error> </check>
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by CedricRey

Hi @lukaspe1 , unfortunately I think this is not possible as you try to do it (did not ever seen that).

But I know you can call the "alert()" method into a JS function with the <soapCall>, it will display a popup just as the alert method in a web browser. (it was available in a 6.0X instance, but should still work today)

It's not very simple, you have to declare a method (into a Schema), implement it in a JS, call it with argument (soapCall > param etc.) to do your check and alert if necessary.

If needed, you can make a general function to display messages to re-use it.

Hope this could help.

(Method implementation : https://experienceleague.adobe.com/docs/campaign-classic/using/configuring-campaign-classic/api/web-service-calls.html?lang=en

and https://experienceleague.adobe.com/docs/campaign-classic/using/configuring-campaign-classic/schema-reference/elements-attributes/method.html?lang=en (don't forget to declare the @library as mentioned in the doc, the function must be named as xxx_schema_Method() pattern in the js file)

SoapCall into forms : https://experienceleague.adobe.com/docs/campaign-classic/using/configuring-campaign-classic/input-forms/form-structure.html?lang=en#soap-methods)

Cedric

 

1 reply

CedricRey
CedricReyAccepted solution
May 9, 2022

Hi @lukaspe1 , unfortunately I think this is not possible as you try to do it (did not ever seen that).

But I know you can call the "alert()" method into a JS function with the <soapCall>, it will display a popup just as the alert method in a web browser. (it was available in a 6.0X instance, but should still work today)

It's not very simple, you have to declare a method (into a Schema), implement it in a JS, call it with argument (soapCall > param etc.) to do your check and alert if necessary.

If needed, you can make a general function to display messages to re-use it.

Hope this could help.

(Method implementation : https://experienceleague.adobe.com/docs/campaign-classic/using/configuring-campaign-classic/api/web-service-calls.html?lang=en

and https://experienceleague.adobe.com/docs/campaign-classic/using/configuring-campaign-classic/schema-reference/elements-attributes/method.html?lang=en (don't forget to declare the @library as mentioned in the doc, the function must be named as xxx_schema_Method() pattern in the js file)

SoapCall into forms : https://experienceleague.adobe.com/docs/campaign-classic/using/configuring-campaign-classic/input-forms/form-structure.html?lang=en#soap-methods)

Cedric

 

LukasPe1
LukasPe1Author
May 9, 2022

@cedricrey  Thank you so much for that suggestion! I had already done the soap-method for validation, so your approach was even more simple 🙂