This block provides a unified master list of organizations. Use this block to apply field-level filtering and standard transformations to organization records.
The Organization Master (OrganizationMaster) Data Block in Assette is a Python-based Transform block designed to retrieve and consolidate organization data from both internal and external systems. It enables standardized output by transforming specific fields (e.g., AccountNumber
to Code
, Website
to Domain
) and supports field-based filtering using optional parameters. This block is useful for centralized, reusable access to organization-level reference data.
General Info #
Field | Value |
---|---|
Name | OrganizationMaster |
Block Category | Transform |
Block Type | Python |
Output Type | Data Table |
Public Block | True |
Editable | True |
Dependecies #
OrganizationReadLocal can be replaced with OrganizationReadSalesforce, depending on the intended data source.
Data Block | Description |
---|---|
ast_fn_table_helpers | Client Python Library used to support data manipulation and formatting operations across other Data Blocks [Link] |
OrganizationReadLocal | Pulls organization reference data directly from Assette’s internal database. [Link] |
Definition #
#Organization master block to get data.
filterparams = {}
if len(params) > 0:
for key, value in params.items():
if value:
filterparams[key] = value
#Use this dependent block to Read organization from local database and Sales force. Dependent blcok has to be changed to switch..
Output = read("OrganizationRead",{})
#Transform results set.
Output = ast_fn_table_helpers.transform_dictionary_list (Output.get("data") or [],{"AccountNumber":"Code","Website":"Domain"})
if len(filterparams)>0:
#Filter results set.
Output = ast_fn_table_helpers.FilterDictionaryByFields(Output,filterparams)
#Transform results set.
response["data"] = ast_fn_table_helpers.transform_dictionary_list (Output,{"AccountNumber":"Code","Website":"Domain"})
Columns #
Column Name | Required | Description |
---|---|---|
Code | Yes | Mapped from AccountNumber , acts as a unique organization identifier |
Domain | No | Mapped from Website , shows the organization’s web domain |
Example Request #
{
"Code": "Apple",
"Name": "Apple",
"Domain": "apple.com",
"Phone": ""
}
Example Response #
The following code shows an example response using the default values of the Data Block. The response may be shortened for brevity.
{
"data": [
{
"Code": "Apple",
"Name": "Apple",
"Domain": "apple.com",
"Phone": null
}
],
"errors": [],
"success": true,
"logs": [],
"sources": []
}