The Find Relational Fields command allows you to search and return details for one or more Fields in a User Defined Relational Table.
Arguments
The Find Relational Field command requires the following arguments: Command, Realm, Password, Table.
api_web?r=myrealm&p=mypass&c=rdbfindfields&table=mytable
The command is 'rdbfindfields', the realm is 'myrealm', the password is 'mypass', and the table to search is 'mytable'. This command returns a list of all fields in the table.
Data columns available to report include:
Field Name (Name) |
Name of Relational Table Field |
Status |
Status of the field: Active, Inactive, Pending, Deleted |
Type |
Data type stored in the Field: Number, Float, String, Date |
Column Length |
Character length allowed for fields of type String. |
Unique |
Is the field unique? true or false |
Required |
Is the field required? true or false |
Import Allowed |
Is the field open to import into? true or false |
Export Allowed |
Can the data be exported from the field? true or false |
Edit Data Allowed |
Can the data in the field be changed? true or false |
Edit Column Allowed |
Can the name of the field be changed? true or false |
Segmentation Allowed |
Is the data available for segmentation? true or false |
The Find Relational Field command supports the following arguments:
Name |
Req? |
Description |
Argument |
Command |
Yes |
Defines the command to use. |
cmd=[rdbfindfields] c=[rdbfindfields] |
Realm |
Yes |
Name of the realm to run the command. This is required, and the command will fail if the realm and password do not match. |
realm=[realm_name] r=[realm_name] |
Password |
Yes |
Authentication code for API access. This is required, and the command will fail if the realm and password do not match. |
pwd=[password] p=[password] |
Relational Table Name |
Yes |
Identifier of the relational data table in which to search. |
table=[table_name] |
Relational Table Status |
|
Limit results to tables with given status. |
relational_status=[all, active,pending,inactive, deleted] DEFAULT==all |
Find Rows |
Only output rows that match the find option setting. If set to 1, then only output the Fields that have the option enabled. For example, if find_segment=1 then only output the fields that allow segmentation. |
find_required=[0,1] find_import=[0,1] find_export=[0,1] find_segment=[0,1] find_editcolumn=[0,1] find_editdata=[0,1] DEFAULT==0 |
|
Show Rows |
Include columns for the setting specified in the output results. If set to 1, then include the column. The output per column is true if the option is enabled for the field and false if the option is not enabled. Show segment, edit column, and edit data are available in 10.7.0 and later. |
show_required=[0,1] show_import=[0,1] show_export=[0,1] show_segment=[0,1] show_editcolumn=[0,1] DEFAULT==0 |
|
Output Format |
|
To specify the format of the list output, use one of two arguments. If no argument is included, the default output is space-delimited plain text string. |
csv=1 or output_format=[csv,csv_tab, csv_pipe,xml] DEFAULT==csv |
Header |
|
To define the data with a label, use the Header argument. This can only be used in conjunction with the output format, and does not affect XML. |
headers=[0,1] DEFAULT==0 |
Example
Using most commands and arguments (please note the command is wrapped for display purposes only):
api_web?r=myrealm&p=mypass&c=rdbfindfields&table=pets&relational_status=active&show_required=1&show_import=1&show_export=1&show_segment=1&show_editcolumn=1&show_editdata=1&output_format=csv&headers=1
Successful results return:
"FieldName","Status","Type","ColumnLength","Unique","Required","Import Allowed","Export Allowed","Edit Column Allowed","Edit Data Allowed","Segmentation Allowed" "subscriber_id","Active","Foreign Key","null","false","true","true","true","true","true","true" "unique_id","Active","INT","null","true","true","false","false","false","false","false" "employeeNum","Active","INT","null","false","false","true","true","true","true","true" "title","Active","NVARCHAR","256","false","false","true","true","true","true","true"
Results
The Find Relational Field command outputs either a SUCCESS or FAILURE message.
SUCCESS
The Find Relational Field command success message returns the SUCCESS message. It also outputs the details in plain text format. Use the output_format argument to return the results in an alternate format. The result format is:
SUCCESS: [number] Tables found [query_results]
FAILURE
The Find Relational Field command will fail for several reasons, such as if the table does not exist. The result format is:
FAILURE: [Reason]