Hi Rob,

There may be other/better ways, but splitting the logging text into an
array on newline characters ('\n`) and then working with the first element
in the array works.
Check the sample script below:

var logging_text = previous_result.getLogText();
if(logging_text != null && logging_text != ''){
  logging_text_array = logging_text.split('\n');
  parent_workflow.setVariable('logging_text', logging_text_array[0]);
  true;
}else{
  parent_workflow.setVariable('logging_text', 'no logging text received');
  false;
}


On Wed, May 22, 2024 at 8:56 PM Rob Burgess <[email protected]> wrote:

> Hi
>
> I'm using a Javascipt to get the error message from the previous action
> using 'previous_result.getLogText()'.
>
> How do I just extract the first line of the error from
> 'previous_result.getLogText()'?
>
> Thanks
>
> Rob
>
>

Reply via email to