cancel
Showing results for 
Search instead for 
Did you mean: 

How to get file size from Directory Browser Snap and use it as a filter condition

pranil2k2
Contributor

HI,

Please can i know how to get file size from Directory Browser Snap and use it as a filter condition in router. i am able see below options in Snap not anything about size.

Thanks in advance.

image

4 REPLIES 4

petar_rajchinos
New Contributor III

Hi pranil2k2,

Once you have the Directory Browser snap configured properly (Directory and file filter fields) you should be able to see output field named $[‘Size (in bytes)’]. You can use that field in the router snap.
DB_size

I’m sharing with you simple pipeline for routing files by size. I’m using shared folder in snaplogic for getting some sample files.
01_DirectoryBrowserSizeIssue_2019_12_02.slp (5.3 KB)

Let me know if you have any questions.

Regards,
Petar

Hi,
Thanks for the help and it worked. i am new to SnapLogic, can i know how where to refer the Size condition/function in SnapLogic. i am not able to find it in expression.

and also can i know how to preview data as shown by you?

Thanks in advance.

image

image

Hi pranil2k2,
In short terms:

When you developing a pipeline in SnapLogic it is really helpful to use Validate option located in the upper right corner (see the picture below).
image
Pipeline validation will give you preview of the data (binary or document) depending of the output type of the snap.

Once you validation is completed you will be able to put the next snap in the pipeline and when you open it, if the expression is enabled (click on the ‘=’ sign) you will be able to see the input schema and also the javascript functions provided by SnapLogic.
image

For more details about the SnapLogic you can use:
The official documentation: https://docs-snaplogic.atlassian.net/wiki/spaces/SD/overview

Regards,
Petar

pranil2k2
Contributor

Hi Petar,

Thanks for the information.