Creating a Function : Directory

Creating a Function : Directory PRODUCT     AVGIDEA, INC. 

The Directory function accepts all files stored under the Storage data source as objects and can be used as input files for data conversion or AI predictive model runs. For example, it is possible to load input data from multiple text files when running an AI prediction model.

Creating a Directory Function

1. Login to the ADP console and select the "Function" -> "Editor" menu.

2. Enter the details of the function, and click the "SAVE" button.

Name : Name of the function

Description : Description of the function

Function Type : File

3. (Optional) Click on the Attach File button to attach a custom Python package to the function as a Zip file.

* AI models can be included in the package and loaded from within the function.

4. Enter any Python program in the text area.

The sample on the left logs the names and file sizes of all files under the Storage data source, where the path variable is a string representing the directory in which each file is stored.

5. Click the "SAVE" button to save the function.

Available Functions and Objects

The following is a list of functions and objects that can be used in the File function.

files : Storage Dictionary object containing file objects stored under the data source (file name is the key)

path : Directory where custom packages are located

out(string) : Output function to output file

log(string) : Output function to execution log

upload(string) : Function to upload locally located files to Storage