cancel
Showing results for 
Search instead for 
Did you mean: 

sizeOf payload

Max
New Contributor II

Hello,

im trying to convert a MuleSoft API to snapLogic. In one of the Mule flows, a choice block is used and the expression sizeOf(payload)==1 is evaluated. How can this same logic be used in snap? Im having trouble accessing payload as snapLogic says payload is undefined. Im trying to use this in the router snap. Im trying to figure out how to write an expression that will evaluate the sizeOf the payload.

1 ACCEPTED SOLUTION

SpiroTaleski
Valued Contributor

@Max 

The SQL Select Snap will not gives you the result as array. 

So, after the SQL Select Snap try to group the output from the select, using Group by N snap, and then calculate the length of the group/array using the length function. 

View solution in original post

3 REPLIES 3

SpiroTaleski
Valued Contributor

@Max 

You can utilize the array length function in SnapLogic.

BR,

Spiro Taleski

Max
New Contributor II

How can this be done?? Im trying to get the sizeOf or length of the payload coming from a SQL select. The attachment shows what is returned from the SQL select. In the next step, how can I access payload from the router snap? There is no array available to do anything with?

SpiroTaleski
Valued Contributor

@Max 

The SQL Select Snap will not gives you the result as array. 

So, after the SQL Select Snap try to group the output from the select, using Group by N snap, and then calculate the length of the group/array using the length function.