Create Account Strategy Model

Configuring Account Strategy in FunnelStory #

This guide walks you through configuring an Account Strategy data model in FunnelStory.

Account strategy is uniquely defined for each account, and once configured, it’s accessible workspace wide.

Steps #

1. Create an Account Strategy data model #

Depending on the customer data, you can add as many model properties as needed. The only required field in this model is the account_id. Text formats supported are - plain text, Markdown, HTML.

The model property names will be prettified and shown in the UI as section headings. So it’s adviced to name them accordingly.

Here’s an example model query which includes Markdown & HTML -

select '360' as account_id, '| Field | Value |
|---|---|
|Account Name|Cisco| |
|Industry|Cisco Systems, Inc., or Cisco, is a multinational technology company that specializes in digital communications.|Learning and Certification|
|Locations|Bangalore| |
|HQ Address|San Jose, California, United States| |
|Nirmata Solution(s)|N4K| |' as objectives_summary, '1 do this <br> 2. do that <br> <b> Test bold </b>' as goals, now() as launch_date;

2. Specify the ordering of Account Strategy sections #

Once the model is configured, we need to mention the order in which each section(property) will appear in the UI. Note: Section headings are derived from model property names.

We store the accounts strategy properties ordering in the workspace defaults. So, we need to make a PUT API call to /api/workspace/defaults The below JS script fetches the existing workspace defaults and makes a PUT request for modifying the Account Strategy section ordering.

async function updateAccountStrategyPropertiesOrdering(...propertyNames) {
    try {
        // Step 1: Fetch existing workspace defaults
        console.log('Fetching existing workspace defaults...');
        const getResponse = await fetch(`/api/workspace/defaults`, {
            "credentials": "include",
            "headers": {
                "Accept": "application/json",
                "Accept-Language": "en-US,en;q=0.5",
            },
            "method": "GET"
        });

        if (!getResponse.ok) {
            throw new Error(`GET request failed: ${getResponse.status} ${getResponse.statusText}`);
        }

        const currentDefaults = await getResponse.json();
        console.log('Current defaults:', currentDefaults);

        // Step 2: Prepare the updated data
        const updatedData = {
            ...currentDefaults.response,
            account_strategy_properties_ordering: propertyNames
        };

        console.log('Updated data to send:', updatedData);

        // Step 3: Make PUT request with updated ordering
        console.log('Updating account strategy properties ordering...');
        const putResponse = await fetch(`/api/workspace/defaults`, {
            "credentials": "include",
            "headers": {
                "Accept": "application/json",
                "Accept-Language": "en-US,en;q=0.5",
                "Content-Type": "application/json"
            },
            "method": "PUT",
            "body": JSON.stringify(updatedData)
        });

        if (!putResponse.ok) {
            throw new Error(`PUT request failed: ${putResponse.status} ${putResponse.statusText}`);
        }

        const result = await putResponse.json();
        console.log('Update successful:', result);
        return result;

    } catch (error) {
        console.error('Error updating workspace defaults:', error);
        throw error;
    }
}

// Example usage:
// updateAccountStrategyPropertiesOrdering('property_1', 'property_2', 'property_3');

Once all the above has been done successfully, you should be able to see the Accounts Strategy tab.