Skip to main content
mohank0008
Known Participant
Apr 12, 2024 12:28 PM UTC
Solved

CONSOLE TO PRINT THE DATA OF LOCAL VARIABLE

Is there any feasability to print the value of a local variable in the runtime & the value it has in the console.  (Like other programming languages for debugging)

karumurua531442
Participating Frequently
Apr 12, 2024 12:46 PM UTC

Hi [mention:7512a2ef378b4c43b97ae5b058da940b:e9ed411860ed4f2ba0265705b8793d05]  what is your requirement initially,  why would you like to print value in runtime. AFAIK I wouldn't be possible print the value of a local variable directly  during runtime. Appian doesn't provide a built-in console for real-time debugging.

11 replies

shubhama926776
Brainy
Apr 12, 2024 12:40 PM UTC

Can you tell me where you expect runtime values in the code, and What do you want to achieve it? An example would be great.

शुभम्
karumurua531442
Participating Frequently
Apr 12, 2024 12:46 PM UTC

Hi [mention:7512a2ef378b4c43b97ae5b058da940b:e9ed411860ed4f2ba0265705b8793d05]  what is your requirement initially,  why would you like to print value in runtime. AFAIK I wouldn't be possible print the value of a local variable directly  during runtime. Appian doesn't provide a built-in console for real-time debugging.

mohank0008
Known Participant
Apr 18, 2024 3:00 AM UTC

I don't have any specific requirement for that; I was just wondering if it exists.

While performing actions on the site, we can observe the values that local variables hold and how routing occurs based on the print statements.

Runtime printed values aid in faster debugging.

Hopefully, this tool will evolve to include a console in upcoming releases.

shubhama926776
Brainy
Apr 18, 2024 3:06 AM UTC

 [mention:7512a2ef378b4c43b97ae5b058da940b:e9ed411860ed4f2ba0265705b8793d05]  Understood your requirement.
No built-in console printing for local variables, but workarounds exist
Display value in Interface, Add text/paragraph component showing the variable value(Mostly developer follow this for interface debugging)

शुभम्
stefanhelzle0001
Brainy
Apr 12, 2024 12:58 PM UTC

What kind of variables and which runtime do you mean?

prakhars0731
Inspiring
Apr 13, 2024 4:37 PM UTC

If you are saying that in expression rule you want to get an output through localvarible yes that is possible but I am not sure what do you mean by runtime

Known Participant
Apr 14, 2024 1:33 PM UTC

you may do it like

a!localVariables(

local!a: 4,

local!b: 5,

local!c: local!a +local!b,

local!c

)

this will print the local!c in the output in expression rule

Brainy
Jun 11, 2024 6:51 AM UTC

[mention:b45a4f6a20b14a008e4e0ec732a8bf98:e9ed411860ed4f2ba0265705b8793d05]  and [mention:dea33493db6342c9a73dc108d45120c0:e9ed411860ed4f2ba0265705b8793d05]  already explained different ways of debugging.

In addition, If you want to print local variable value in logs, you can try logmessage plug-in (community.appian.com/.../log-a-message).

a!localVariables(
  local!data: "Message printed by logmessage function..........",
  local!info: logmessage("ERROR", local!data),
  local!data
)

Output:

The following will be printed in tomcat-stdOut.log file:
2024-06-11 07:24:30,614 [http-nio-8080-exec-995] ERROR com.incessant.plugins.logMessageMain.LogMessage - Message printed by logmessage function..........

I hope this helps.

mohank0008
Known Participant
Feb 1, 2026 12:57 PM UTC

Server Error in '/' Application.


Runtime Error

Description: An exception occurred while processing your request. Additionally, another exception occurred while executing the custom error page for the first exception. The request has been terminated.

[mention:c3d4bf332aba4695885fdc0e0110ec6e:e9ed411860ed4f2ba0265705b8793d05]  - I could not access the link

stefanhelzle0001
Brainy
Feb 1, 2026 2:05 PM UTC

The search function in the app market returned this updated link:

community.appian.com/.../log-a-message