AnsweredAssumed Answered

Passing a Report into a PUT_READ_BUFFER

Question asked by Matt_Woelfel_1344 on Jul 10, 2014
Latest reply on Jul 16, 2014 by Jennifer_Jinhong_34

I am looking to pass the entire report of one object, into another object. So far I know how to iterate through each line of the report and print it out to the post process report.

:set &hnd# = prep_process_report()
:process &hnd#
:  set &line# = get_process_line(&hnd#)
:  print "Line &num# = &line#"
:  set &num# = &num#+1
:endprocess

In the end goal, I am looking to :READ the report into a Web Service object and set one of the fields equal to the report so it will fill out a field in Service Now.

1q9ssfbw94qh.jpg

I have also been able to put the lines of the report into an array script variable, but when using the put_read_buffer, it requires me to specify an index, when I would like to pass the entire array into the put_read_buffer variable.

Here is the rough script I ave when using the array:

:set &num# = 1
:define &arr#, string, 500
:set &hnd# = prep_process_report(,)
:process &hnd#
:  set &arr#[&num#] = get_process_line(&hnd#)
:  print "Line &num# = &arr#[&num#]"
:  set &num# = &num#+1
:endprocess

:set &num2# = 1

:WHILE &num# <> &num2#
:  print "Array Index &num2# = &arr#[&num2#]"
:  set &num2# = &num2#+1
:ENDWHILE

Of course the issue with this is I am not able to put this all into the description field. I am also wondering if this is even possible (one of the reason for asking this question) since a string cannot have more than 1024 characters (I believe), and reports often have more characters than that.

Thank you all in advance for your help!

Outcomes