Return Multiple Values to Next Script Entry Points

There are scenarios where we have to pass or return multiple values to another Entry point, so that value can process as per the requirement.
Normally, The first Return statement that holds some specific data in any Entry point is accessible to next Point by logging the context in initial line.
This is not feasible in cases where we return more number of values to next state, if we pass as a separate variable or something like that. (No issues, If we declare variable as Global)
Can be resolved by passing as an array of elements.

var arr=[];
arr.push({
           id: internal_id,
           fileContent: rowObj
         })
return arr;

//Here, internal_id & rowobj are two separate values that required to pass in next Entry Point.
(context value. fileContent.data ; will display the rowObj value
)

Leave a comment

Your email address will not be published. Required fields are marked *