# MediaSet.Count() Method
> Version: _Available or changed with runtime version 1.0._
Gets the number of media objects that are included in the MediaSet of a record.
## Syntax
```al
Count :=   MediaSet.Count()
```
> NOTE
> This method can be invoked using property access syntax.
## Parameters
MediaSet
Type: mediaset-data-type
An instance of the mediaset-data-type data type.
## Return Value
Count
Type: ../integer/integer-data-type
The number of media objects that are included in the MediaSet of a record.
## Example
This example counts the number of media objects that are available for item No. 1000 in table 27 Item of the CRONUS demonstration database. In this example, the field in the Item table that is used for the MediaSet data type is Picture.
```al
 var
    itemRec: Record Item;
    count: Integer;
    Text000: Label 'The number of media files: %1';
begin
    itemRec.Get('1000');
        count := (itemRec.Picture.Count);
        Message(Text000,count);
end;
```
## Related information
mediaset-data-type
Get Started with AL<../../devenv-get-started>
Developing Extensions<../../devenv-dev-overview>

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/mediaset/mediaset-count-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/mediaset/mediaset-count-method/
