# Search by Resource Metadata

Search resources by metadata property from Apex.

> Kind: Apex method · Updated: 2026-07-01

## Signature

```apex
global static List<ResourceList> searchByProperty(
  List<Types.SearchByPropertyInput> inputs,
  String library,
  String runAs
)
```

### Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| inputs | List&lt;<a href="#/apex-type-search-by-property-input">Types.SearchByPropertyInput</a>&gt; | required | List of search-property input objects, each pairing a metadata property with the value to match. |
| library | String | required | Type of library. Example — sharepoint. You can get this value from Content Library. |
| runAs | String | optional | Email Id of the user on whose behalf the function should run. To run the action as the automation user, supply integrationUser. |

## Return Type

List<ResourceList&gt; — one Resource List per input.

## Example

```apex
List<cldfs.ResourceList> returnedList = new List<cldfs.ResourceList>();
List<cldfs.Types.SearchByPropertyInput> searchInputs = new List<cldfs.Types.SearchByPropertyInput>();

cldfs.Types.SearchByPropertyInput searchInput = new cldfs.Types.SearchByPropertyInput(
    'name',//Property
    'CloudFiles',//Value
    'b!nJBtPq_z5UeJtFrj_f24XEQqlPUD8vtFsg7GBcrXJepiUn9bkb_7QbDPtqHVD-cP'//DriveId
);
searchInputs.add(searchInput);
returnedList = cldfs.Client.searchByProperty(
    searchInputs,
    'sharepoint',
    'integrationUser'
);
```
