I don't think there is such JS builtin function. Usually, such distinction is not required.
Out of curiosity, why do you need it, and what you would do differently depending on the way the workflow was started?
I have a workflow that modifies existing values of an object using prepopulated fields for input data. When using the UI the user can delete the data in the field meaning that the contents are meant to be erased, however when using the REST API the absence of the field means that the field is not to be modified. In the UI I was a null value to mean erase while in REST it means do not modify. I'll find another approach to solve the issue. I was hoping for some standard way to tell.
1 person found this helpful
Well, when starting the workflow via REST API call, you can pass additional parameter(s) in 'token' scope, and then in the workflow scripting you can access them using ExecutionContext. So this way you can pass some flag indicating that origin of the workflow execution is a manual REST API call.
But I don't like this hidden change of the behavior. Why don't you add a normal boolean parameter asking the user to explicitly choose whether the missing stuff should be erased or not modified?
I'll look into this. I don't like that the user has to explicitly chose between erase or modify. However I think I found a solution. Seems like a cleared form field is still an empty string vs null if the parameter is not passed in. I can just use that test. Thanks for the info.