Skip to main content
Version: 1.28 (Current)

Read Multiple Entities

Audience: Low-code Engineers

Skill Prerequisites: Actions, Connectors, Lists, Tokens

Searches a Dynamics 365 / Dynamics CRM entity (table) with conditions and loads all the matching records into a list. Each record becomes one list entry, with a property for each attribute (column) you map.

You can then go through the list with Execute Actions for each List Entry, or use it with the other list actions. It can also read large results one page at a time.

note

This action is part of the Dynamics (CRM, 365) add-on (DnnSharp.DynamicsCrm). The add-on is installed separately and needs the DYNCRM feature in your license. If it isn't licensed, the action fails with a "not licensed" error. If you don't see the Dynamics actions, the add-on isn't installed.

Typical Use Cases​

Don't use it to​

  • Read one record by its GUID. Use Read Entity instead.
  • Get only the first match as tokens. Use Find Entity instead.
Action NameDescription
Find EntityLoads the first matching record into tokens.
Read EntityReads one record by its GUID.
Execute Actions for each List EntryRuns actions once for each record in the list.
Update EntityUpdates a record by its GUID, for example inside a loop over the list.
Delete EntityDeletes a record by its GUID.
Test ConnectorChecks that a Dynamics Service Connector can sign in.

Input Parameter Reference​

ParameterDescriptionSupports TokensDefaultRequired
ConnectorThe Dynamics Service Connector that holds the Dynamics server address and sign-in details. See Connectors.NoemptyYes
Context Entity NameThe name of the list to create, for example ContactsList.Yesempty stringYes
Logical NameThe entity to search. The list shows the entities of the selected connector by display name. The value saved is the entity's logical name, for example contact or account. You can also type a logical name or a token. The value is converted to lowercase.Yesempty stringYes
Id MappingThe name of the list property that receives each record's GUID, for example ContactId. Leave it empty if you don't need the GUID. It can't be the same as one of the Entity Property Name values in Attribute Mapping.Yesempty stringNo
Attribute MappingThe attributes to read. For each row, enter the attribute's logical name in Attribute Name, for example fullname, and the list property to create in Entity Property Name, for example ContactName. Attribute names that don't exist on the entity are skipped. See List properties.NoNoneNo
ConditionsThe filter. Each row has a Logical Operator (And/Or), an Attribute Name (logical name), a Condition Operator and a Value. See Conditions. With no rows, all records are read.Only in ValueNoneNo
Order BySorts the records. Each row has an Attribute Name and an Order Type. See Considerations.NoNoneNo
Result CountThe number of records per page, for example 50. Paging is only used when both Result Count and Page Number are greater than 0.Yes0No
Page NumberThe page to read, starting at 1.Yes0No
Paging CookieThe paging cookie from a previous Read Multiple Entities with the same query. It helps Dynamics return the next page quickly. It's ignored when paging isn't used.Yesempty stringNo
Output Paging CookieThe name of the token that receives the paging cookie for the next page, for example ContactsPagingCookie.Noempty stringNo
Output Total Records CountThe name of the token that receives the number of records that match the query, for example ContactsTotal.Noempty stringNo

Output Parameters Reference​

OutputDescription
List <Context Entity Name>The list of records, one entry per record. Empty if nothing matches.
[<Output Paging Cookie>]The paging cookie to pass to the next page's Paging Cookie. Only created when Output Paging Cookie is set.
[<Output Total Records Count>]The number of matching records reported by Dynamics. Only created when Output Total Records Count is set.

List properties​

Each list entry has:

  • The Id Mapping property, if set, with the record's GUID
  • One property per row of Attribute Mapping, named by Entity Property Name
  • For reference attributes (Lookup, Customer, Owner), three extra properties: <Entity Property Name>:Id, <Entity Property Name>:Name and <Entity Property Name>:LogicalName

Inside Execute Actions for each List Entry, use them as [ListName:PropertyName], for example [ContactsList:ContactName] or [ContactsList:ParentAccount:Id].

The values follow the same rules as Find Entity:

  • If Dynamics returns a formatted value for the attribute, the property gets that. For example, an option set gives its label (Active), not its number.
  • Date and time attributes are written in ISO 8601 format, for example 2026-09-27T14:30:00.0000000Z. Date Only attributes use the short date format of the current culture.
  • Otherwise, the raw value is used: money as its amount, option sets as their number, and references as the GUID.
  • If the attribute is empty in Dynamics, the property is empty.

Conditions​

Conditions work the same as in Find Entity. The Value column supports tokens. For In, NotIn, Between and NotBetween, put each value on its own line. Null and NotNull take no value. Rows are combined with And, and an Or row starts an Or group that includes the rows after it.

Paging​

Without paging, the action reads what Dynamics returns in one request. Dynamics limits this, usually to 5,000 records. To read more, or to show results page by page:

  1. Set Result Count to the page size, Page Number to 1, and set Output Paging Cookie and Output Total Records Count.
  2. For the next page, run the action again with the same query, Page Number increased by one, and Paging Cookie set to the cookie token.
  3. Stop when you've read [<Output Total Records Count>] records, or when the list comes back empty.

Considerations​

  • Use a new list name. The action fails if a list with the same Context Entity Name already exists in the context. When reading several pages, use a different name per page, for example ContactsPage[PageNumber]List.
  • Order Type isn't applied in 1.28. Sorting always uses ascending order, whatever Order Type says.
  • Use logical names. Entity and attribute names are the lowercase logical names, such as emailaddress1, not display names such as Email.
  • Map only what you need. Only mapped attributes are read. Fewer attributes make the request faster.
  • Conditions compare with Dynamics values. For option sets, compare with the number, not the label. For references, compare with the GUID.
  • The sign-in is cached. The connection is reused until its security token is about to expire. Use Test Connector to check a connector. See Add Connector to create one in actions.
  • Errors. Wrong sign-in details, a wrong entity name or an invalid condition make the action fail. Use the On Error actions of Execute Actions to handle it.

Examples​

tip

To understand how to use the below examples, please see Running Examples.

In these examples, replace the connector Entry value with the ID of your own Dynamics Service Connector, or select the connector after importing.

1. Read the contacts of an account​

This action reads every contact whose parent is the account in the AccountId token, sorted by name. It creates the ContactsList list. Each entry has ContactId, ContactName and ContactEmail. [ContactsTotal] holds the number of contacts.

{
"Title": "Read Multiple Entities",
"ActionType": "DynamicsCrm.ReadMultipleEntities",
"Description": "Load the account's contacts",
"Parameters": {
"Credentials": {
"Entry": "00000000-0000-0000-0000-000000000000"
},
"ContextEntityName": "ContactsList",
"LogicalName": "contact",
"IdMapping": "ContactId",
"AttributeMapping": {
"fullname": "ContactName",
"emailaddress1": "ContactEmail"
},
"Conditions": [
{
"LogicalOperator": "And",
"AttributeName": "parentcustomerid",
"ConditionOperator": "Equal",
"Value": "[AccountId]"
}
],
"OrderBy": [
{
"AttributeName": "fullname",
"OrderType": "Ascending"
}
],
"OutputTotalRecordsCount": "ContactsTotal"
}
}

Next, add Execute Actions for each List Entry with List Name set to ContactsList. Inside it, use [ContactsList:ContactEmail] and [ContactsList:ContactName], for example in a Send Email action.

2. Read one page of accounts​

This action reads 50 accounts from the page in the PageNumber token, whose names start with the text in the Search token. It saves the cookie for the next page in [AccountsPagingCookie] and the number of matching accounts in [AccountsTotal]. For the first page, set PageNumber to 1 and AccountsPagingCookie to an empty value.

{
"Title": "Read Multiple Entities",
"ActionType": "DynamicsCrm.ReadMultipleEntities",
"Description": "Load a page of accounts",
"Parameters": {
"Credentials": {
"Entry": "00000000-0000-0000-0000-000000000000"
},
"ContextEntityName": "AccountsPage[PageNumber]List",
"LogicalName": "account",
"IdMapping": "AccountId",
"AttributeMapping": {
"name": "AccountName",
"accountnumber": "AccountNumber",
"primarycontactid": "PrimaryContact"
},
"Conditions": [
{
"LogicalOperator": "And",
"AttributeName": "name",
"ConditionOperator": "BeginsWith",
"Value": "[Search]"
}
],
"ResultCount": "50",
"PageNumber": "[PageNumber]",
"PagingCookie": "[AccountsPagingCookie]",
"OutputPagingCookie": "AccountsPagingCookie",
"OutputTotalRecordsCount": "AccountsTotal"
}
}

Each entry also has PrimaryContact:Id, PrimaryContact:Name and PrimaryContact:LogicalName, because primarycontactid is a lookup.

Revised 09/27/2026