Get Folder Details

You can retrieve the details of the folders created in the Catalyst File Store. It can be a single folder or all the folders located in the file store. The filestore reference used in the below code snippets is the component instance created earlier.

Get Details of a Single Folder

This particular method retrieves the details of a specific folder referred through its unique Folder ID by calling getFolderDetails() method.

The promise is returned here which in turn resolves to the folder meta details. The resultant meta can be converted to a String or a JSON output by accessing the .toString() or .toJSON() method.

    
copy
//Get a single folder with details by passing the folder id which in turn returns a promise let filestore = app.filestore(); let folderPromise = filestore.getFolderDetails(1510000000109545); folderPromise.then((folder) => { console.log(folder); });

A sample response that you will receive for each version is shown below:

    
Node JS
copy
{
"folder_name":"Store_Data",
"created_time":"Aug 13, 2021 05:32 PM",
"created_by":{
"zuid":"66466723",
"is_confirmed":false,
"email_id":"emma@zylker.com",
"first_name":"Amelia",
"last_name":"Burrows",
"user_type":"Admin",
"user_id":"2136000000006003"
},
"modified_time":"Aug 13, 2021 05:32 PM",
"modified_by":{
"zuid":"66466723",
"is_confirmed":false,
"email_id":"emma@zylker.com",
"first_name":"Amelia",
"last_name":"Burrows",
"user_type":"Admin",
"user_id":"2136000000006003"
},
"project_details":{
"project_name":"ShipmentTracking",
"id":"2136000000007733",
"project_type":"Live"
},
"file_details":[
{
    "id":"2136000000020111",
    "file_location":null,
    "file_name":"Img.jpeg",
    "file_size":"84881",
    "created_by":{
      "zuid":"66466723",
      "is_confirmed":false,
      "email_id":"p.boyle@zylker.com",
      "first_name":"Patricia",
      "last_name":"Boyle",
      "user_type":"Admin",
      "user_id":"2136000000006767"
    },
    "created_time":"Aug 17, 2021 09:32 PM",
    "modified_by":{
      "zuid":"66466723",
      "is_confirmed":false,
      "email_id":"p.boyle@zylker.com",
      "first_name":"Patricia",
      "last_name":"Boyle",
      "user_type":"Admin",
      "user_id":"2136000000006767"
    },
    "modified_time":"Aug 17, 2021 09:32 PM",
    "project_details":{
      "project_name":"ShipmentTracking",
      "id":"2136000000007733",
      "project_type":"Live"
    },
    "folder_details":"2136000000008551"
}
],
"id":"2136000000008551"
}
}
{
"folder_name":"Store_Data",
"created_time":"Aug 13, 2021 05:32 PM",
"created_by":{
"zuid":66466723,
"is_confirmed":false,
"email_id":"emma@zylker.com",
"first_name":"Amelia",
"last_name":"Burrows",
"user_type":"Admin",
"user_id":2136000000006003
},
"modified_time":"Aug 13, 2021 05:32 PM",
"modified_by":{
"zuid":66466723,
"is_confirmed":false,
"email_id":"emma@zylker.com",
"first_name":"Amelia",
"last_name":"Burrows",
"user_type":"Admin",
"user_id":2136000000006003
},
"project_details":{
"project_name":"ShipmentTracking",
"id":2136000000007733,
"project_type":"Live"
},
"file_details":[
{
  "id":2136000000020111,
  "file_location":null,
  "file_name":"invoice1349.jpeg",
  "file_size":84881,
  "created_by":{
      "zuid":66466723,
      "is_confirmed":false,
      "email_id":"p.boyle@zylker.com",
      "first_name":"Patricia",
      "last_name":"Boyle",
      "user_type":"Admin",
      "user_id":2136000000006767
  },
  "created_time":"Aug 17, 2021 09:32 PM",
  "modified_by":{
      "zuid":66466723,
      "is_confirmed":false,
      "email_id":"p.boyle@zylker.com",
      "first_name":"Patricia",
      "last_name":"Boyle",
      "user_type":"Admin",
      "user_id":2136000000006767
  },
  "modified_time":"Aug 17, 2021 09:32 PM",
  "project_details":{
      "project_name":"ShipmentTracking",
      "id":2136000000007733,
      "project_type":"Live"
  },
  "folder_details":2136000000008551
}
],
"id":2136000000008551
}

Get Details of All Folders

You can fetch the details of all folders in your Catalyst application using the getAllFolders() method.

The promise returned here will be resolved to an array of folder meta details.

    
copy
//Get details of all the folders in the project let filestore = app.filestore(); let allFolderPromise = filestore.getAllFolders(); allFolderPromise.then((folders) => { console.log(folders); });

A sample response that you will receive for each version is shown below:

    
Node JS
copy
[
{
"folder_name":"Invoices",
"created_time":"Aug 25, 2021 11:38 AM",
"created_by":{
"zuid":"66466723",
"is_confirmed":false,
"email_id":"emma@zylker.com",
"first_name":"Amelia",
"last_name":"Burrows",
"user_type":"Admin",
"user_id":"2136000000006003"
},
"modified_time":"Aug 25, 2021 11:38 AM",
"modified_by":{
"zuid":"66466723",
"is_confirmed":false,
"email_id":"emma@zylker.com",
"first_name":"Amelia",
"last_name":"Burrows",
"user_type":"Admin",
"user_id":"2136000000006003"
},
"project_details":{
"project_name":"ShipmentTracking",
"id":"2136000000007733",
"project_type":"Live"
},
"id":"2136000000037021"
},
{
"folder_name":"Store_Data",
"created_time":"Aug 13, 2021 05:32 PM",
"created_by":{
"zuid":"66466723",
"is_confirmed":false,
"email_id":"emma@zylker.com",
"first_name":"Amelia",
"last_name":"Burrows",
"user_type":"Admin",
"user_id":"2136000000006003"
},
"modified_time":"Aug 13, 2021 05:32 PM",
"modified_by":{
"zuid":"66466723",
"is_confirmed":false,
"email_id":"emma@zylker.com",
"first_name":"Amelia",
"last_name":"Burrows",
"user_type":"Admin",
"user_id":"2136000000006003"
},
"project_details":{
"project_name":"ShipmentTracking",
"id":"2136000000007733",
"project_type":"Live"
},
"id":"2136000000008551"
}
]
[
{
"folder_name":"Invoices",
"created_time":"Aug 25, 2021 11:38 AM",
"created_by":{
"zuid":66466723,
"is_confirmed":false,
"email_id":"emma@zylker.com",
"first_name":"Amelia",
"last_name":"Burrows",
"user_type":"Admin",
"user_id":2136000000006003
},
"modified_time":"Aug 25, 2021 11:38 AM",
"modified_by":{
"zuid":66466723,
"is_confirmed":false,
"email_id":"emma@zylker.com",
"first_name":"Amelia",
"last_name":"Burrows",
"user_type":"Admin",
"user_id":2136000000006003
},
"project_details":{
"project_name":"ShipmentTracking",
"id":2136000000007733,
"project_type":"Live"
},
"id":2136000000037021
},
{
"folder_name":"Store_Data",
"created_time":"Aug 13, 2021 05:32 PM",
"created_by":{
"zuid":66466723,
"is_confirmed":false,
"email_id":"emma@zylker.com",
"first_name":"Amelia",
"last_name":"Burrows",
"user_type":"Admin",
"user_id":2136000000006003
},
"modified_time":"Aug 13, 2021 05:32 PM",
"modified_by":{
"zuid":66466723,
"is_confirmed":false,
"email_id":"emma@zylker.com",
"first_name":"Amelia",
"last_name":"Burrows",
"user_type":"Admin",
"user_id":2136000000006003
},
"project_details":{
"project_name":"ShipmentTracking",
"id":2136000000007733,
"project_type":"Live"
},
"id":2136000000008551
}
]

Last Updated 2023-09-03 01:06:41 +0530 +0530