• Home
  • Visit Our Website
  • Home
  • Visit Our Website
Visit Our Website

Users

168
  • Getting Started
    • How to Log into Assette
    • The Assette Home Page
    • The Assette Navigation Bar
    • Glossary
  • Authoring Center
    • Smart Docs
      • Smart Docs
      • How to Create a Smart Doc
      • Copying and Restoring from Version History
      • Tracking Changes with Life Events
      • Smart Docs X-Ray View
      • Smart Doc Troubleshooting
      • Troubleshooting
        • Troubleshooting Smart Docs
    • Smart Pages
      • Creating & Editing Smart Pages
      • Smart Pages
      • How to Unlock a Smart Page
      • Deleting Smart Pages
      • Tracking Changes with Life Events
      • How to Insert Blank Columns and Rows
      • Changing a Smart Page’s Size
      • Supported PowerPoint Charts
      • Copying and Restoring from Version History
      • Smart Page X-Ray View
      • Smart Page Content Classifications
      • Compliance Tags
      • Assette Editors
        • PowerPoint Editor
          • How to Add New Series to a Chart
          • How to Insert Images Using the Assette Ribbon
          • Assette Ribbon
            • The “Un-Fabricate” Button
          • Troubleshooting
            • Resolving “Failed to Open” Errors in the Assette PPTX Editor
            • Installing the Assette PowerPoint Editor
            • How to Check Your Microsoft PowerPoint Version
          • Advanced Settings
            • Advanced Settings Overview
            • General Tab
            • Margin Tab
            • Zigzag Tab
    • Disclosures
      • Managing Disclosure Fragment Categories
      • Creating or Editing a Disclosure Fragment
      • Disclosures versus Footnotes
      • Disclosures
    • Fixed Content
      • Fixed Content
    • Data Docs
      • Data Docs
    • Smart Shells
      • How to Preview Smart Shells
      • Coupled Shells
      • Smart Shells
      • Tracking Changes with Life Events
      • Copying and Restoring from Version History
      • Creating Smart Shells Using the Smart Shell Library
      • Editing Smart Shells Using the Smart Shell Library
      • Creating Smart Shells via Assette’s PowerPoint Editor
      • How to Refresh Smart Shells
      • Deleting Smart Shells
      • Renaming Smart Shells
      • Smart Shells X-Ray View
      • Smart Shell Content Classifications
      • Performance History Chart
      • Smart Shells Frequently Asked Questions (FAQ)
      • Creating an “As of Date” Smart Shell
    • Brand Themes
      • Assette Dynamic Brand Theme Setup
      • Brand Themes
      • Managing Multiple Themes Within a Single Brand Theme
      • Creating a Brand Theme
      • Shell Styling
      • Dynamic Brand Themes
      • Master Slide Layouts for Dynamic Brand Themes
      • Changing a Smart Page’s Size
    • Email Templates
      • Using Variables in Assette Email Templates
      • Email Templates
    • Additional Features
      • Using Quick View in Assette
      • Automatic Extension Correction
      • X-Ray View Overview
      • The Generation Screen
    • Authoring FAQs
      • Understanding the Difference Between My Workspace and Workrooms
      • What’s the Difference between Footnotes & Coupled Shells?
  • Content Hub
    • Library
      • Saved Trays in the Assette Library
      • Content Library
      • Content Generation and Sharing with Content Library
    • My Workspace
      • Copying Content to My Workspace
      • My Workspace
    • RFPs & DDQs
      • Editing an RFP Answer
      • Uploading an RFP to the Assette
      • RFPs & DDQs
    • Workrooms
      • How to Edit Content in a Workroom
      • Copying Content to a Workroom
      • Workroom
    • Assette Viewer
      • Disabling or Removing the Assette Outlook Add-in
      • Assette Viewer Overview
      • Assette Viewer Basics
    • Content Center
      • How to Add a New Organization to the Organization Master
      • Content Plan Data Model
      • Content Plans
      • Content Types
      • Using Advanced Search in the Content Library
  • Data Engine
    • Input Center
      • Input Center Overview
      • Data Files Overview
      • Recipients
      • External Content Overview
    • Data Files
      • Troubleshooting Data Files Uploads
    • Qualitative Data
      • Adding and Editing People in Qualitative Data
      • Qualitative Data
      • Ownership Data
      • Firm Overview
      • People Data
      • Master Questionnaire
    • Developer Center
      • Developer Tools Overview
  • Analytics
    • Usage Analytics
      • Content Sharing Analytics
    • Component Analytics
      • Component Analytics
      • Using X-Ray with Component Analytics
      • Templates Analytics
        • Templates Dashboard
      • Section Analytics
        • Sections Dashboard
      • Shell Analytics
        • Shells Dashboard
      • Data Block Analytics
        • Data Blocks Dashboard
  • Administration
    • Workbox
      • Workbox Basics
    • Content Types Master
      • Creating an Input File Content Type
      • Understanding Purpose in Content Types
      • Content Groups
      • Creating Content Types
      • Content Classes
      • Content Filename Aliases
    • Users
      • Work Group Basics
      • Internal Users
        • Internal User Roles & Responsibilities
        • Manually Creating Users in Assette
        • Reset or Unlock User’s Accounts
        • SSO Internal User Roles & Tasks
      • Work Groups
        • Creating & Editing Work Groups
        • Creating Subgroups
    • Workflows
      • Workflows Basics
      • Workflow Frequently Asked Questions (FAQ)
      • Workflow Management
        • Workflow Management Overview
        • Workflow Reassignment
      • Workflow Design
        • Client Portal User Approval Workflow
        • Editing or Deleting a Workflow
        • Creating a Workflow
        • Creating Conditional Workflows
    • Product Master
      • Composite vs. Rep Accounts
      • Product Master Overview
      • Deactivating & Deleting Products
      • Troubleshooting Product Master Errors
    • Classification Master
      • Classification Master Overview
      • How to Manage Content Classifications
      • Creating & Managing Labels
      • Labels
      • Limitations
      • Compliance Tags
      • Data Ingredients Overview
    • Configurations
      • Attribution Data Objects Configurations
  • Client Portal
    • Security Overview for the Assette Client Portal
    • Client Portal Overview
    • Creating Notifications for Client Portal Users
    • Client Portal Users
      • Client Portal User Workflow Lifecycle
      • Client Portal Frequently Asked Questions (FAQ)
      • Client Portal Session Handling
      • Log into the Assette Client Portal
      • Managing User Access in the Client Portal
      • Creating a New Portal User
      • Editing or Creating Portal Users
      • Deleting a Client Portal User
      • Monitoring and Accessing User Login Activity for Client Portal
  • Tutorials
    • When to Create a New Artefact in Assette
    • Creating a Fixed-Row Zigzag Table
  • Legacy Support
    • Assette Centers [Legacy]
    • Data Validations [Legacy]
    • Assette Roles Overview [Legacy]
    • Create & Manage Attributes [Legacy]
    • Internal Users Management [Legacy]
    • Legacy Authoring Center
      • Data Object Library [Legacy]
      • Data Docs [Legacy]
      • Smart Shells [Legacy]
      • How to Create a New Smart Page [Legacy]
      • Legacy Smart Pages
        • Creating and Editing Smart Pages [Legacy]
      • Legacy Smart Docs
        • Creating a Smart Doc [Legacy]

Developers

202
  • Getting Started
    • The Assette Navigation Bar
    • User Login & Creation
      • Add Assette Users with Azure AD
      • Developer Roles & Permissions
      • How to Create & Assign Permission Groups
      • Permission Groups Overview
    • Implementation Overview
      • Introduction to Assette Implementation
      • The Assette Implementation Approach
      • What Data is Required to Start?
      • Connecting to Source Systems with Assette
      • Essential Data Blocks
      • Fields Synchronized with Assette
  • Developer Tools
    • Tool Setup
      • Assette Development Stack
      • Developer Center Configurations
      • Prohibited Data Block Keywords and Built-ins
      • Master Data Scheduler
      • Python Data Block Libraries & Keywords
      • Troubleshooting
        • Troubleshooting AxiosError-500 Errors
        • Assette VS Code Extension Troubleshooting
      • Visual Studio Code
        • Assette Visual Studio Code Extension
        • How to Find Where a Component is Used in the VS Code Extension
        • Error and Status Messages Reference
        • Signing Into the Assette VS Code Extension
        • VS Code Frequently Asked Questions (FAQs)
        • Installing the Assette Block Editor VS Code Extension
        • Assette VS Code Extension Troubleshooting
    • Data Block Editor
      • Using Nested Functions in Data Blocks
      • Importing Python Libraries
      • Import & Export Data Blocks
      • Data Block Unit Testing in Python
      • Data Block Editor Basics
        • Introduction to the Data Block Editor
        • Calculation Operators and Precedence
        • Secret Management
        • How to Copy & Delete Data Blocks
        • Creating & Editing Data Blocks
        • How to Freeze Data Blocks
      • Data Block Keywords
        • Understanding the “response” Keyword in Assette Data Blocks
        • Understanding the ‘read’ Keyword in Assette Data Blocks
      • Data Block Editor Metadata
        • How to Update Data Block Metadata
      • Data Block Editor Troubleshooting
        • Troubleshooting API Authentication Issues
    • Data Object Editor
      • Applying Row Filtration with Data Objects
      • Locking a Data Object
      • Introduction to the Data Object Editor
      • Dynamic Row Numbering
      • Force Unlocking a Data Object
      • Editing Data Objects
      • Creating Data Objects
      • Data Object KeyError
      • How to Copy & Delete Data Objects
      • Generation Time Data Settings
      • Importing & Exporting Data Objects
      • Design View
        • Data Settings Tab
          • Data Settings Tab
        • General Info Tab
          • General Info
          • Styling Classes
        • Data Source Tab
          • Data Source Tab
        • Columns Tab
          • Columns Tab
          • Date Formats
        • Groupings Tab
          • Grouping Tab
          • Group Expressions & Group Ordering
          • Creating Group Header Rows
          • Creating Group Summary Rows
          • How to Create “Group By” Data Settings
        • Sorting Tab
          • Sorting Tab
        • Summary Tab
          • Summary Tab
        • Row Types Tab
          • Row Types Tab
        • Title & Footnotes Tab
          • Title & Footnotes Tab
        • Legend Tab
          • Legend Tab
        • Output Variables Tab
          • Output Variable Tab
        • Internal Variables Tab
          • Internal Variables
          • Internal Variable Type Assignment
        • No Data Message Tab
          • No Data Message Tab
      • Expressions
        • The “round(value, n)” Expression
        • Expressions, Operators, & Functions
        • The “Contains()” Function
        • The “HasValue()” Function
        • The “NOT” Operator
        • The “OR” Operator
        • The “<> Not Equal To” Operator
        • The “>= Greater Than or Equal To” Operator
        • The “ADD” Expression
        • The “AND” Expression
        • The “Divide” Expression
        • The “Minus” Expression
        • The “Multiply” Expression
        • The “<= Less Than or Equal to” Operator
        • The > Greater Than Operator
        • The “==” Equals Operator
        • The Grouping Operator “()”
        • The < Less Than Operator
    • Dynamic Fields
      • Dynamic Fields
    • Footnote Editor
      • Footnote X-Ray View
      • Footnote Editor
      • How to Create & Edit Footnotes
      • Import Variables & Columns
    • Tenant Manager
      • Deployment Statuses
      • Tenant Manager Overview
      • Deploy Content Using the Assette Tenant Manager
      • Review Artifacts
      • Tenant Manager Troubleshooting
      • Tenants in the Tenant Manager
      • Deployment Processing & Error Logging
  • Data Blocks
    • Data Block Basics
      • Publishing Data Blocks
      • Data Block Basics
      • Data Block Categories
      • Data Block Request Parameters
    • Account Master
      • Account Master Data Block
      • Filtering the Account Master Using Account Codes
    • Data Blocks by Category
      • Understanding Assette Data Blocks
      • System Data Blocks
        • Organization Add Data Block
        • Organization Master Data Block
        • Get Recipient Info Salesforce Transform Data Block
        • Get Recipient Info Salesforce Data Blocks
        • Get Recipients LocalDB Data Block
        • Get Recipient Info Local Data Block
        • Recipient Master Data Block
        • Attribute Type Values Local Data Block
        • Brand Theme Selector Data Block
        • Brand Theme Extract Data Block
        • System Data Blocks Overview
        • Account Master Data Block
        • Asset Classes Local Data Block
        • As of Dates Data Block
        • Countries Data Block
        • Currency Codes Data Blocks
        • Product Master Data Block
        • Sub Accounts Client Database Data Block
        • Sub Accounts Local Database Data Block
        • Sector Schemes Data Blocks
        • Sectors Data Block
        • Sub Accounts Data Block
      • Sync Data Blocks
        • Sync Data Block Overview
        • Country List Sync Data Block
        • Product Master Sync Data Block
        • Attribute Type Values Sync Data Block
      • Source Data Blocks
        • Source Product Offer Countries Data Block
        • Source Sub-Accounts Relationship Data Block
        • Source List of Attribute Type Values Data Block
        • Source Extract Accounts Details Data Block
        • Source Account Attributes Values Data Block
        • Source List of Currency Codes Data Block
        • Source Product Master Extract Data Block
      • Transform Data Blocks
        • Assette Get Valid Periods Data Block
        • System Period Information Data Block
        • Assette Get Begin & End Date Data Block
        • Source Extract Accounts Details Data Block
      • Interface Data Blocks
        • Organization Read Local Data Block
        • Sectors Local Database Data Block
        • Assette Period Code Map Data Block
        • Account Attribute Mapping Local Database Data Block
        • Account Attributes Local Database Data Block
        • Source Product Master Extract Data Block
        • Source List of Currency Codes Data Block
        • Source Account Attributes Values Data Block
        • Product Master Local Data Base Data Block
      • Configuration Data Blocks
        • Salesforce Settings Data Block
        • Configuration Data Block Overview
        • Calculation Python Environment Data Block
        • Python Data Calculation Modules Data Block
        • Python Environment for Date Calculation Data Block
        • Demo Snowflake Setting Data Block
        • Snowflake Demo Certificate Data Block
        • Calculation Environment Data Block
    • Data Blocks by Functionality
      • Get Major Minor Ticker Data Block
  • Data Objects
    • Data Objects
    • Data Object X-Ray View
    • Introduction to Data Objects
  • Integrations
    • Connecting Salesforce with Assette
    • Snowflake
      • Source Account Attributes Values Data Block
      • Snowflake Integration
    • Aprimo
      • Assette-Aprimo Integration Overview
      • Inserting Content with Aprimo
      • Aprimo Image Library Data Block
      • Aprimo Thumbnail Image Library API Data Block
      • Modifying the Aprimo API Records Data Block
      • Aprimo Data Blocks
        • Aprimo API Post Order Data Block
        • Aprimo Image Thumbnail Data Block
        • Aprimo API Single Record Data Block
        • Aprimo API Records Data Block
        • Aprimo API Order Status
        • Image Content Data Block
  • Developer FAQ
    • Batch Generation Architecture
    • How to Add a New Product to the Product Master
    • How to Add New Attributes to the Attribute Master
    • Data Blocks Frequently Asked Questions (FAQ)
    • Data Object Frequently Asked Questions (FAQ)
    • Tenant Manager Frequently Asked Questions (FAQ)
    • TLS Email Encryption via SendGrid
    • Data Block Cheat Sheet
    • Why Can’t I Edit a Data Object?
    • How Do Unit Tests Work in Assette?
    • Enable Assette Add-In in Case of Failure
    • How Do I Log into Snowflake?
    • Period Codes
    • Developer Tools FAQs
      • Removing Blank or NULL Columns
      • How to Display Different Values in the Account Code Dropdown in the Data Object Editor Preview
      • When and Why You See an Impact Change Message in the Developer Center
  • Tutorials
    • Creating a Correlation Matrix Table
    • Data Block Tutorials
      • Structuring Data for Time-Series Charts in PowerPoint
      • How to Cache Data Using Data Blocks
      • Creating a Certificate Data Block
      • Making Public API Calls Using Assette Data Blocks
      • Using Data Blocks to Make API Calls
    • Data Object Tutorials
      • Creating Dynamic Column Headings
implementation

Implementation

18
  • Getting Started
    • Welcome to the Assette Implementation Guide
  • Planning Your Implementation
    • Assette 101
    • The Three Layer Model
    • What to Expect from Implementation
  • Platform Layers
    • The Data Engine
    • Authoring Center
    • Content Hub
  • Assemble Your Implementation Team
    • Technical Environment & Tenant Setup
    • Building Your Implementation Dream Team
    • Scaling Your Implementation Across Strategies & Modules
  • Working With Data
    • Content Inputs
    • Prepare and Shape Your Data
    • Real-Word Examples
  • Implementation Process & Support
    • How ACE Training Works
    • Implementation Steps
    • Analyze Backward, Build Forward
    • Assette Support & Roles
    • ACE Syllabus
  • Home
  • Docs
  • Developers
  • Data Blocks
  • Account Master
  • Filtering the Account Master Using Account Codes

Filtering the Account Master Using Account Codes

5 min read

In Assette, it is common for firms to create custom Data Blocks that source data from system-defined blocks, such as the Account Master Data Block. In this article, we’ll refer to any such custom Data Block that queries the Account Master Data Block simply as “CustomBlock”. The CustomBlock Data Block is intended represent a Data Block which retrieves information for a single account based on user input.

This article explains why this happens, how to handle it properly, and how the behavior changes depending on whether you’re using one or multiple filtering parameters.

Understanding the Account Master Data Block #

The Account Master Data Block is a System Data Block provided by Assette. It includes complex logic to support a wide variety of filtering use cases across products, strategies, countries, and more. It is used behind the scenes by many components, and its behavior is intentionally flexible.

However, because of this flexibility, its filtering logic can behave differently based on the parameters passed to it — especially these three:

  • Code
  • AccountCode
  • AccountCodeList

How Code, AccountCode, and AccountCodeList Interact #

When you pass parameters to AccountMaster, it goes through internal pre-processing logic that determines how the filtering will be applied. Here’s how these parameters influence the final behavior:

Code #

This is the main identifier used by AccountMaster Data Block to retrieve specific accounts.

If Code contains multiple values (e.g., "12345,67890" or "12345|67890"), the logic assumes it is a list and moves the value to AccountCodeList. Code is then cleared to avoid ambiguity. As seen in the Account Master Data Block:

if Code != "" and "," in Code:
    AccountCodeList = str(Code).replace(",", "|")
    Code = ""
elif Code != "" and "|" in Code:
    AccountCodeList = Code
    Code = ""

AccountCode #

  • This is typically the parameter passed from a user interface or calling block when the user selects a single account.
  • Inside AccountMaster, if AccountCode is populated, it is automatically copied to the Code parameter if Code is not already set.
if (params.get("AccountCode") or "") != "":
    Code = params.get("AccountCode")
    if (params.get("Code") or "") == "":
        params["Code"] = Code

AccountCodeList #

  • This parameter is used when multiple accounts are being requested.
  • If Code is treated as a list, it ends up here. This means your intended single-account filter could be silently broadened, causing AccountMaster to return multiple accounts.

The Role of Custom Data Blocks #

Many firms use a custom block, referred to here as “CustomBlock”, which is responsible for returning details about a single account. This block typically reads from AccountMaster and extracts specific fields like AccountID, Name, StrategyName, ProductCode, or RepAccountCode. This version assumes that the read() call will return exactly one record, which is often not the case due to the behavior described above.

A typical simplified definition of CustomBlock might look like this:

errors = []
data = {}

account_detail_keyset = {"AccountID", "Name", "StrategyName", "ProductCode", "RepAccountCode"}

try:
    account_master = read("AccountMaster", {"Code": str(params["AccountCode"])})["data"][0]
    for key in account_detail_keyset:
        if key in account_master:
            data[key] = account_master[key]
except:
    errors.append("Error reading AccountMaster block.")

response["data"] = data
response["errors"] = errors

Problem Scenario: Only One Parameter Is Used #

When only one filtering parameter is passed — such as AccountCode — the results can be unpredictable if the value is misinterpreted by AccountMaster.

{
"AccountCode": "bblcvmodel"
}

If “bblcvmodel” is interpreted as a list (e.g., if it accidentally includes a comma or pipe), it is moved to AccountCodeList, and Code is cleared. As a result, the AccountMaster block performs a broad search, possibly returning multiple accounts. In your custom CustomBlock, the line:

account_master = read("AccountMaster", {"Code": str(params["AccountCode"])})["data"][0]

will return the first record, which may not be the correct account.

Solution: Filter the Result Locally in CustomBlock #

To ensure correctness, especially when only one parameter is being used, you should:

  1. Allow AccountMaster to return multiple results.
  2. Apply local filtering in your CustomBlock block to find the specific match.

Updated Logic #

account_master_data = read("AccountMaster", {"Code": str(params["AccountCode"])})["data"]

account_master = next(
    (item for item in account_master_data if item.get("Code") == str(params["AccountCode"])),
    None
)

if account_master:
    for key in bg_account_detail_keyset:
        if key in account_master:
            data[key] = account_master[key]

This ensures that even if AccountMaster returns multiple records, you only use the one that matches the provided AccountCode.

When Two or More Parameters Are Used #

If you provide multiple parameters — such as both ProductCode and StrategyName — the filtering behavior in AccountMaster becomes more targeted.

filters = 
    "ProductCode": "EQUITY",
    "Strategy": "Core"
}
account_master_data = read("AccountMaster", filters)["data"]

In this case, AccountMaster will try to return only those accounts that match both conditions. However, even this may not guarantee a single result, depending on your data.

You should still apply local filtering inside CustomBlock if you’re looking for a specific account:

account_master = next(
    (item for item in account_master_data
     if item.get("ProductCode") == "EQUITY" and item.get("StrategyName") == "Core"),
    None
)

Dynamic Parameter Handling #

You can dynamically construct your filter dictionary based on the parameters the user provides:

filters = {}
if params.get("ProductCode"):
    filters["ProductCode"] = params["ProductCode"]
if params.get("StrategyName"):
    filters["Strategy"] = params["StrategyName"]
if params.get("AccountCode"):
    filters["Code"] = params["AccountCode"]

account_master_data = read("AccountMaster", filters)["data"]

This keeps your logic flexible and scalable without assuming which parameters will always be available.

Best Practices #

The following table summarized the various scenarios discussed above and provided the recommended approach in each case.

ScenarioRecommended Approach
Only AccountCode usedPass Code to AccountMaster, filter locally in CustomBlock
Only non-unique param used (e.g., StrategyName)Pass it as filter, expect multiple, filter locally
Multiple parameters usedPass all filters, still validate locally in case of multiple results
Want strict match on single accountAlways apply next(... for item in data if item["Code"] == ...)
Relying solely on ["data"][0]Not recommended — may return wrong account
Account Master Data Block
Still stuck? How can we help?

How can we help?

Updated on April 9, 2025
Page Index
  • Understanding the Account Master Data Block
  • How Code, AccountCode, and AccountCodeList Interact
    • Code
    • AccountCode
    • AccountCodeList
  • The Role of Custom Data Blocks
  • Problem Scenario: Only One Parameter Is Used
  • Solution: Filter the Result Locally in CustomBlock
    • Updated Logic
  • When Two or More Parameters Are Used
  • Dynamic Parameter Handling
  • Best Practices
Stay up to date on Assette news and updates with our Newsletter:
  • Platform
  • Modules
  • AssetteAI
  • Who We Are
  • Who We Work With
  • Platform
  • Modules
  • AssetteAI
  • Who We Are
  • Who We Work With
  • Platform
  • Modules
  • AssetteAI
  • Who We Are
  • Who We Work With
  • Platform
  • Modules
  • AssetteAI
  • Who We Are
  • Who We Work With
  • Blog
  • News
  • Events
  • Contact
  • Blog
  • News
  • Events
  • Contact
  • Blog
  • News
  • Events
  • Contact
  • Blog
  • News
  • Events
  • Contact

4 Faneuil Hall, 4th Floor
Boston, MA
02109 USA
Tel: +1.617.723.6161

Book a Demo
X-twitter Linkedin Youtube
  • Privacy Policy
  • © 2025 Assette. All Rights Reserved
  • Powered By Artrivo (PVT) Ltd.