Skip to main content
March 13, 2023
Question

Capture Smart Service Error Message from Expression

  • March 13, 2023
  • 4 replies
  • 0 views

If a Smart Service has a onError argument, can I capture the error message of what went wrong?  For example, the createUser SmartService has an onSuccess and onError arguments.  In the onSuccess, I can capture the created user with fv!user.  Which is great.  But in the onError, I don't see anything that will tell me what went wrong.

I know the system knows what went wrong because if I happen to wrap the call to the createUser call in a WebAPI, I can see in the "Details" section of the "Smart Service Executed" response it says, "The username requested is not available".  But I want to capture that text so that I can log/report it and I don't see a way to do that.  I want to know more than "It failed".  I want to be able to report what actually went wrong.

Thanks in advance,
Steve

4 replies

stefanhelzle0001
Brainy
March 13, 2023

Did you see that this smart service requires that it is executed in the context of an admin account? Running it inside a user interface does not make much sense.

But, in general, I agree, the error cause should be available.

March 13, 2023

This was simply a trivial example to give some context to my question:  When running a smart service from an expression how does one capture what went wrong if/when it fails.

stefanhelzle0001
Brainy
March 13, 2023

So, some smart service functions do return values if they fail. This would be documented. Like for a!startProcess

https://docs.appian.com/suite/help/23.1/Start_Process_Smart_Service.html#node-outputs