Skip to main content

Retrieving calculated values from the Profiles Store

Your calculated attributes are stored in the Profiles Store, and retrieved using services.

To use attributes to take action in your application, you'll want to retrieve only the relevant values. This would usually be the attributes for the current user.

For example, use the current user's unique domain_userid identifier to retrieve attributes defined against the domain_userid attribute key.

You have three options for consuming attributes, depending on your use case or application:

Start by connecting to Signals.

Using a service

The preferred way to retrieve attributes is by using a service. This allows you to retrieve attributes in bulk, from multiple attribute groups.

Use get_service_attributes() to retrieve attributes from a service. Signals will return the attributes as a dictionary.

Here's an example:

# The Signals connection object has been created as sp_signals

calculated_values = sp_signals.get_service_attributes(
name="my_service",
attribute_key="domain_userid",
identifier="218e8926-3858-431d-b2ed-66da03a1cbe5",
)

The table below lists all available arguments for get_service_attributes()

ArgumentDescriptionTypeRequired?
nameThe name of the servicestring
attribute_keyThe attribute key to retrieve attributes forstring
identifierThe specific attribute key valuestring

Retrieving individual attributes

You can also retrieve attributes directly from a specific attribute group. This is useful when:

  • You want to retrieve only a small subset of attributes
  • You haven't defined a service yet

Use get_group_attribtues() to retrieve specific attributes. Signals will return the attributes as a dictionary.

Here's an example:

# The Signals connection object has been created as sp_signals

calculated_values = sp_signals.get_group_attribtues(
name="my_attribute_group",
version=1,
attributes=["page_view_count"],
attribute_key="domain_userid",
identifier="218e8926-3858-431d-b2ed-66da03a1cbe5",
)

The table below lists all available arguments for get_group_attribtues()

ArgumentDescriptionTypeRequired?
nameThe name of the attribute groupstring
versionThe attribute group versionint
attributesThe names of the attributes to retrievestring or list of string
attribute_keyThe attribute key namestring
identifierThe specific attribute key valuestring

On this page

Want to see a custom demo?

Our technical experts are here to help.