Skip to content

aws.connect.get_current_user_data

Example SQL Queries

SELECT * FROM
aws.connect.get_current_user_data
WHERE
"instance_id" = 'VALUE'
AND "filters" = 'VALUE';

Description

Gets the real-time active user data from the specified Amazon Connect instance.

Table Definition

Column NameColumn Data Type
filters Required Input Column

The filters to apply to returned user data. You can filter up to the following limits:

  • Queues: 100

  • Routing profiles: 100

  • Agents: 100

  • Contact states: 9

  • User hierarchy groups: 1

The user data is retrieved for only the specified values/resources in the filter. A maximum of one filter can be passed from queues, routing profiles, agents, and user hierarchy groups.

Currently tagging is only supported on the resources that are passed in the filter.

STRUCT(
"queues" VARCHAR[],
"contact_filter" STRUCT(
"contact_states" VARCHAR[]
),
"routing_profiles" VARCHAR[],
"agents" VARCHAR[],
"user_hierarchy_groups" VARCHAR[]
)
Show child fields
filters.agents[]
filters.contact_filter

A filter for the user data based on the contact information that is associated to the user. It contains a list of contact states.

Show child fields
filters.contact_filter.contact_states[]
filters.queues[]
filters.routing_profiles[]
filters.user_hierarchy_groups[]
instance_id Required Input Column

The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

VARCHAR
max_results Input Column

The maximum number of results to return per page.

BIGINT
next_token Input Column

If there are additional results, this is the token for the next set of results.

VARCHAR
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

_aws_region Input Column

The AWS region to use.

VARCHAR
approximate_total_count

The total count of the result, regardless of the current page size.

BIGINT
user_data_list

A list of the user data that is returned.

STRUCT(
"user" STRUCT(
"id" VARCHAR,
"arn" VARCHAR
),
"routing_profile" STRUCT(
"id" VARCHAR,
"arn" VARCHAR
),
"hierarchy_path" STRUCT(
"level_one" STRUCT(
"id" VARCHAR,
"arn" VARCHAR
),
"level_two" STRUCT(
"id" VARCHAR,
"arn" VARCHAR
),
"level_three" STRUCT(
"id" VARCHAR,
"arn" VARCHAR
),
"level_four" STRUCT(
"id" VARCHAR,
"arn" VARCHAR
),
"level_five" STRUCT(
"id" VARCHAR,
"arn" VARCHAR
)
),
"status" STRUCT(
"status_start_timestamp" TIMESTAMP_S,
"status_arn" VARCHAR,
"status_name" VARCHAR
),
"available_slots_by_channel" MAP(VARCHAR, BIGINT),
"max_slots_by_channel" MAP(VARCHAR, BIGINT),
"active_slots_by_channel" MAP(VARCHAR, BIGINT),
"contacts" STRUCT(
"contact_id" VARCHAR,
"channel" VARCHAR,
"initiation_method" VARCHAR,
"agent_contact_state" VARCHAR,
"state_start_timestamp" TIMESTAMP_S,
"connected_to_agent_timestamp" TIMESTAMP_S,
"queue" STRUCT(
"id" VARCHAR,
"arn" VARCHAR
)
)[],
"next_status" VARCHAR
)[]
Show child fields
user_data_list[]
Show child fields
user_data_list[].active_slots_by_channel

A map of active slots by channel. The key is a channel name. The value is an integer: the number of active slots.

user_data_list[].available_slots_by_channel

A map of available slots by channel. The key is a channel name. The value is an integer: the available number of slots.

user_data_list[].contacts[]
Show child fields
user_data_list[].contacts[].agent_contact_state

The state of the contact.

When AgentContactState is set to CONNECTED_ONHOLD, StateStartTimestamp is not changed. Instead, StateStartTimestamp reflects the time the contact was CONNECTED to the agent.

user_data_list[].contacts[].channel

The channel of the contact.

user_data_list[].contacts[].connected_to_agent_timestamp

The time at which the contact was connected to an agent.

user_data_list[].contacts[].contact_id

The identifier of the contact in this instance of Amazon Connect.

user_data_list[].contacts[].initiation_method

How the contact was initiated.

user_data_list[].contacts[].queue

Contains information about a queue resource for which metrics are returned.

Show child fields
user_data_list[].contacts[].queue.arn

The Amazon Resource Name (ARN) of the queue.

user_data_list[].contacts[].queue.id

The identifier of the queue.

user_data_list[].contacts[].state_start_timestamp

The epoch timestamp when the contact state started.

user_data_list[].hierarchy_path

Contains information about the levels of a hierarchy group assigned to a user.

Show child fields
user_data_list[].hierarchy_path.level_five

Information about level five.

Show child fields
user_data_list[].hierarchy_path.level_five.arn

The Amazon Resource Name (ARN) for the hierarchy group.

user_data_list[].hierarchy_path.level_five.id

The unique identifier for the hierarchy group.

user_data_list[].hierarchy_path.level_four

Information about level four.

Show child fields
user_data_list[].hierarchy_path.level_four.arn

The Amazon Resource Name (ARN) for the hierarchy group.

user_data_list[].hierarchy_path.level_four.id

The unique identifier for the hierarchy group.

user_data_list[].hierarchy_path.level_one

Information about level one.

Show child fields
user_data_list[].hierarchy_path.level_one.arn

The Amazon Resource Name (ARN) for the hierarchy group.

user_data_list[].hierarchy_path.level_one.id

The unique identifier for the hierarchy group.

user_data_list[].hierarchy_path.level_three

Information about level three.

Show child fields
user_data_list[].hierarchy_path.level_three.arn

The Amazon Resource Name (ARN) for the hierarchy group.

user_data_list[].hierarchy_path.level_three.id

The unique identifier for the hierarchy group.

user_data_list[].hierarchy_path.level_two

Information about level two.

Show child fields
user_data_list[].hierarchy_path.level_two.arn

The Amazon Resource Name (ARN) for the hierarchy group.

user_data_list[].hierarchy_path.level_two.id

The unique identifier for the hierarchy group.

user_data_list[].max_slots_by_channel

A map of maximum slots by channel. The key is a channel name. The value is an integer: the maximum number of slots. This is calculated from MediaConcurrency of the RoutingProfile assigned to the agent.

user_data_list[].next_status

The Next status of the agent.

user_data_list[].routing_profile

Information about the routing profile that is assigned to the user.

Show child fields
user_data_list[].routing_profile.arn

The Amazon Resource Name (ARN) of the routing profile.

user_data_list[].routing_profile.id

The identifier of the routing profile.

user_data_list[].status

The status of the agent that they manually set in their Contact Control Panel (CCP), or that the supervisor manually changes in the real-time metrics report.

Show child fields
user_data_list[].status.status_arn

The Amazon Resource Name (ARN) of the agent's status.

user_data_list[].status.status_name

The name of the agent status.

user_data_list[].status.status_start_timestamp

The start timestamp of the agent's status.

user_data_list[].user

Information about the user for the data that is returned. It contains the resourceId and ARN of the user.

Show child fields
user_data_list[].user.arn

The Amazon Resource Name (ARN) for the user.

user_data_list[].user.id

The unique identifier for the user.