Search Contents (Metadata Query)

Operation Name

Search Contents (Metadata Query)

Function Overview

This operation retrieves a list of Box contents (files or folders) that match conditions by using a metadata query.
For details on API specifications used by this component, refer to the Box API reference at the following URL.

Data Model

Data model of this type of component is table model type.

Properties

For details on using variables, refer to "Variables".
Basic Settings
Item name Required/Optional Use of variables Description Remarks
Name Required Not available Enter the name on the script canvas.  
Input data Optional Not available Select a component on the script canvas.  
Required Settings
Item name Required/Optional Use of variables Description Remarks
Destination Required Not available Select Global Resources.
For details on global resource settings, refer to "Global resource properties".
  • [Add]:
    Add a new global resource.
  • [Edit list]:
    Allows you to edit the global resource settings in "Edit resource list".
 
Owner Required Available Enter the email address that the folder owner uses to log in.  
Specification method for Box content Required Not available Select a method to specify Box content.
  • [Path]: (default)
    Allows you to specify Box content with a path.
  • [ID]:
    Allows you to specify Box content with an ID.
 
Folder path Required Available Enter the folder path on Box.
  • This item is displayed only when [Specification method for Box content] is [Path].
  • For more details on path format, refer to "Limitations".
Folder ID Required Available Enter the folder ID on Box.
  • This item is displayed only when [Specification method for Box content] is [ID].
Metadata template name Required Available Select or enter the name of the metadata template used for search.  
Property Action
Item name Description Remarks
Update the list of metadata template names Retrieve metadata templates from the specified destination, and set them in [Metadata template name].
  • If [Destination] is changed, you can apply the change by using this property action.
  • Enabled when [Destination] is selected.
Query Settings
Item name Required/Optional Use of variables Description Remarks
Metadata field list Optional - Metadata fields in the metadata template specified in [Metadata template name] are displayed.  
Metadata field list/Display name Optional Not available The display names of metadata fields are displayed.  
Metadata field list/Key Optional Not available The keys of metadata fields are displayed.  
Metadata field list/Type Optional Not available The types of metadata fields are displayed.  
Query Optional Available Enter a query used for a content search.
  • You can use "Query argument".
  • For details on queries, refer to "The query parameter" on the following web page in Box Guides:
    • https://developer.box.com/guides/metadata/queries/syntax/
Query argument Optional - The query arguments specified in [Query] are set.
  • This item is not displayed when query arguments are not used in [Query].
  • The query argument names displayed in [Query argument] are displayed in the output schema in Mapper.
Query argument/Query argument name Required Not available The name of the query argument is set.
  • This item is not displayed when query arguments are not used in [Query].
Query argument/Type Required Not available Specify the type of the query argument.
  • This item is not displayed when query arguments are not used in [Query].
  • The type is displayed in the "<type> (<internal data type>)" format.
Sort settings Optional - Specify the sort order for search results based on the metadata template specified in [Metadata template name].

Each column can be operated with the following buttons:
  • [Add]:
    Add a new column.
  • [Up]:
    Move the order of the selected column up by one.
  • [Down]:
    Move the order of the selected column down by one.
  • [Delete]:
    Delete the column.
 
Sort settings/Metadata field name Required Not available Select the metadata fields to sort.
Sort settings/Order Required Not available Select the sort order.
  • [Ascending]: (default)
    Sort in ascending order.
  • [Descending]:
    Sort in descending order.
 
Property Action
Item name Description Remarks
Update the list of metadata fields Retrieve metadata fields from the specified metadata template and display them in [Metadata field list]. Also, update the [Metadata field name] list.
  • If [Metadata template name] is changed, you can apply the change by using this property action.
  • Enabled when [Destination] and [Metadata template name] are selected.
Comment
Item name Required/Optional Use of variables Description Remarks
Comment Optional Not available You can write a short description of this adapter.
The description will be applied to the specifications.
 

Schema

Input Schema

The number of columns differs depending on the settings for [Query argument].
For details on schema structure, refer to "Table model type schema".

Output Schema

<?xml version="1.0" encoding="UTF-8" ?>
<table>
  <row>
    <column>box_content_id</column>
    <column>box_content_type</column>
  </row>
  <row>
    :
  </row>
</table>
Element name Label Description Remarks
row
-
Repeated for the number of contents searched for.  
column box_content_id The ID is output.  
box_content_type The type is output.
  • "file": Files
  • "folder": Folders
 

Loading Schema on Mapper

The schema is loaded automatically.
For details, refer to "Edit Schema".

Mass Data Processing

Mass data processing is not supported.

Transaction

Transaction is not supported.

PSP Usage

PSP is not supported.

Available Component Variables

Component variable name Description Remarks
count The number of retrieved contents is stored.
  • The default value is "0".
file_count The number of retrieved files is stored.
  • The default value is "0".
folder_count The number of retrieved folders is stored.
  • The default value is "0".
message_category When an error occurs, the category of the message code corresponding to the occurred error is stored.
  • The default value is null.
message_code When an error occurs, the code of the message code corresponding to the occurred error is stored.
  • The default value is null.
message_level When an error occurs, the severity of the message code corresponding to the occurred error is stored.
  • The default value is null.
error_type When an error occurs, the type of the occurred error is stored.
  • The default value is null.
  • The error type will be in the following format.
    Example: "java.io.FileNotFoundException"
  • The contents to be stored may vary depending on the version of DataSpider Servista.
error_message When an error occurs, the message of the occurred error is stored.
  • The default value is null.
  • The contents to be stored may vary depending on the version of DataSpider Servista.
error_trace When an error occurs, the trace information of the occurred error is stored.
  • The default value is null.
  • The contents that will be stored may vary depending on the version and client applications of DataSpider Servista.

Query Argument

In the Content Search (Metadata Query) operation, you can use query arguments.

How to Use Query Arguments

Query arguments can be set using a string starting with a colon (:) and including alphanumeric characters and an underscore (_). Values for query arguments are set in Mapper.

For example, if you write "amount >= :amount AND country = :country" in [Query], two query arguments ("amount" and "country") can be changed dynamically. When this Content Search (Metadata Query) operation is set as output for Mapper, "amount" and "country" are displayed in the output schema in Mapper. In Mapper, you can map "amount" and "country" separately to set values.

Specification Limits

Major Exceptions

Exception Name Cause Solution
ResourceNotFoundException
Resource definition is not found. Name:[]
[Destination] is not specified. Specify a value for [Destination].
ResourceNotFoundException
Resource definition is not found. Name:[<Name of global resources>]
Resource definition selected in [Destination] is not found. Check the global resource specified in [Destination].
InvalidPropertyConfigurationException
Required item <property name> is not entered.
[<Property name>] is not entered. Enter a value in [<property name>].
InvalidPropertyConfigurationException
A forbidden value for Box was entered in the Owner field.
The user specified in [Owner] does not exist. Specify an existing owner in Box for [Owner].
InvalidPropertyConfigurationException
Enter a valid folder path in the Folder path field.
[Folder path] is invalid. Check the following.
  • Whether the content specified by [Folder path] exists
  • Whether the content specified by [Folder path] is a folder
InvalidPropertyConfigurationException
Enter a valid ID in the Folder ID field.
[Folder ID] is invalid. Check the following.
  • Whether the content specified by [Folder ID] exists
  • Whether the content specified by [Folder ID] is a folder
InvalidPropertyConfigurationException
Enter a valid metadata template name in the Metadata template name field.
[Metadata template name] is invalid. Specify an existing metadata template name in Box for [Metadata template name].
InvalidPropertyConfigurationException
The type of the query argument <query argument name> is not entered.
[Type] of [Query argument] is not entered. Enter a value in [Type] of [Query argument].
InvalidPropertyConfigurationException
The metadata field that is not defined in the metadata template is used in the sort settings. Metadata field name: <metadata field name>
The metadata field selected for [Metadata field name] in [Sort settings] is not defined in the metadata template specified for [Metadata template name]. Execute [Update the list of metadata fields] and then select [Metadata field name] again.
QueryArgumentNotSpecifiedException
The query argument <query argument name> is not entered.
A value for the query argument is not set. Set a value for the query argument.
BoxClientException Box has returned an error. For details on messages, refer to the document portal for Box developer (https://developer.box.com/).