# GetPsoFields - Common queries

## PSO fields on the web interface <a href="#getpsofields-commonqueries-psofieldsonthewebinterface" id="getpsofields-commonqueries-psofieldsonthewebinterface"></a>

<figure><img src="https://865014297-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmPIS3ypETYfqx7oxISkC%2Fuploads%2Fl7zS4278rbHMeVWUFAMp%2Fimage-20250113-101151.png?alt=media&#x26;token=e65240fe-6f68-4f5a-885e-3c3921b08412" alt=""><figcaption></figcaption></figure>

## Get number of fields in a PSO <a href="#getpsofields-commonqueries-getnumberoffieldsinapso" id="getpsofields-commonqueries-getnumberoffieldsinapso"></a>

Get the Employee “USR” PSO number of fields.

**Query**

```graphql
query GetPsoFields {
    getPsoFields (alias: "usr", first: 1) {
        totalCount
    }
}
```

**Response**

```json
{
    "data": {
        "getPsoFields": {
            "totalCount": 86
        }
    },
    "errors": null
}
```

the Key “totalCount” returns the number of fields available in a PSO.

## Get PSO Fields Details <a href="#getpsofields-commonqueries-getpsofieldsdetails" id="getpsofields-commonqueries-getpsofieldsdetails"></a>

#### **Query - Get All fields**

```graphql
query GetPsoFields {
    getPsoFields(alias: "usr", first: 86, filter: { isActive: null }) {
        totalCount
        edges {
            node {
                isActive
                alias
                createdAt
            }
        }
    }
}
```

#### **Query - Get All active Fields**

```graphql
query GetPsoFields{
    getPsoFields(alias: "usr", first: 86, filter: { isActive: true }) {
        totalCount
        edges {
            node {
                isActive
                alias
                createdAt
            }
        }
    }
}
```

#### **Response**

```json
{
    "data": {
        "getPsoFields": {
            "totalCount": 86,
            "edges": [
                {
                    "node": {
                        "isActive": true,
                        "alias": "professional_phone",
                        "createdAt": "2018-03-22T08:59:33Z"
                    }
                },
                {
                    "node": {
                        "isActive": true,
                        "alias": "professional_mobile_phone",
                        "createdAt": "2018-03-22T08:59:33Z"
                    }
                },
                {
                    "node": {
                        "isActive": true,
                        "alias": "professional_email",
                        "createdAt": "2018-03-22T08:59:33Z"
                    }
                },
{
                    "node": {
                        "isActive": true,
                        "alias": "usr_first_name",
                        "createdAt": "2018-03-22T08:59:34Z"
                    }
                },
                {
                    "node": {
                        "isActive": true,
                        "alias": "usr_last_name",
                        "createdAt": "2018-03-22T08:59:34Z"
                    }
                },
                {
                    "node": {
                        "isActive": true,
                        "alias": "username",
                        "createdAt": "2018-03-22T08:59:34Z"
                    }
                },
........
........

                {
                    "node": {
                        "isActive": true,
                        "alias": "usr_evp_variable",
                        "createdAt": "2024-02-23T08:23:23Z"
                    }
                },
                {
                    "node": {
                        "isActive": true,
                        "alias": "usr_date_format",
                        "createdAt": null
                    }
                },
                {
                    "node": {
                        "isActive": true,
                        "alias": "usr_time_format",
                        "createdAt": null
                    }
                },
                {
                    "node": {
                        "isActive": true,
                        "alias": "usr_poste_empowill",
                        "createdAt": "2024-05-31T13:11:05Z"
                    }
                }
            ]
        }
    },
    "errors": null
}
```

## Get PSO Specific Fields <a href="#getpsofields-commonqueries-getpsospecificfields" id="getpsofields-commonqueries-getpsospecificfields"></a>

**Query**

Find the active field named “professional\_phone”

```graphql
query GetPsoFields{
    getPsoFields(
        alias: "usr"
        first: 1
        filter: { isActive: true, alias: "professional_phone" }
    ) {
        totalCount
        edges {
            node {
                isActive
                alias
                createdAt
            }
        }
    }
}
```

**Response**

```json
{
    "data": {
        "getPsoFields": {
            "totalCount": 1,
            "edges": [
                {
                    "node": {
                        "isActive": true,
                        "alias": "professional_phone",
                        "createdAt": "2018-03-22T08:59:33Z"
                    }
                }
            ]
        }
    },
    "errors": null
}
```
