# How to find "priority" tasks in PostgreSQL

**URL:** <https://forum.communityhealthtoolkit.org/t/how-to-find-priority-tasks-in-postgresql/1937>\
**Category:** Development\
**Tags:** tasks, data\
**Created:** [June 15, 2022, 8:49pm UTC](https://forum.communityhealthtoolkit.org/t/how-to-find-priority-tasks-in-postgresql/1937 "2022-06-15T20:49:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/michael/32/319_2.png) [@michael](https://forum.communityhealthtoolkit.org/u/michael)\
**Post date:** [June 15, 2022, 8:49pm UTC](https://forum.communityhealthtoolkit.org/t/how-to-find-priority-tasks-in-postgresql/1937/1 "2022-06-15T20:49:38Z")

</div>

I’m trying to do some research on “Priority” tasks… tasks where the `priority.level` [property](https://docs.communityhealthtoolkit.org/apps/reference/tasks/#tasksjs) is set to `high`.

The [database schema documentation for tasks](https://docs.communityhealthtoolkit.org/core/overview/db-schema/#tasks) makes no specific mention of this property, though I imagine it would show up in the `emission` property (_Minified task data emitted from the partner code_) if anywhere.

Will the `priority.level` property be included in the “minified task data…”?

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [June 17, 2022, 9:20am UTC](https://forum.communityhealthtoolkit.org/t/how-to-find-priority-tasks-in-postgresql/1937/2 "2022-06-17T09:20:14Z")

</div>

Hi @michael

Priority level and label will be included in the minified task emission:

```auto
{
  .....
  "type": "task",
  "emission": {
    "_id": "3da4835d-9ba9-4f53-8726-4053b75c867c~pregnancy-home-visit4067~a random task2",
    "title": "task.anc.pregnancy_home_visit.title",
    "icon": "icon-pregnancy",
    "deleted": false,
    "resolved": false,
    "actions": [
      {
        "type": "report",
        "form": "pregnancy_home_visit",
        "label": "Pregnancy home visit",
        "content": {
          "source": "task",
          "source_id": "3da4835d-9ba9-4f53-8726-4053b75c867c"
        }
      }
    ],
    "priority": "high",
    "priorityLabel": "HIGH PRIO",
    "contact": {
      "name": "nettles"
    },
    "dueDate": "2023-01-18",
    "startDate": "2023-01-12",
    "endDate": "2023-01-25",
    "forId": "6a9753a607e0f0b01eacf517ed00276a"
  },
  "state": "Draft"
}

```

The documentation should be updated to correct the missing references to priority level + label.

---

<div class="post-metadata">

**Author:** ![michael](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/michael/32/319_2.png) [@michael](https://forum.communityhealthtoolkit.org/u/michael)\
**Post date:** [May 10, 2023, 12:39am UTC](https://forum.communityhealthtoolkit.org/t/how-to-find-priority-tasks-in-postgresql/1937/3 "2023-05-10T00:39:43Z")

</div>

Closing the loop on this…[I’ve added](https://github.com/medic/cht-docs/commit/3bd4d56d03caf40b6fffd45f530f18c21c710444) priority/label to the [documentation](https://docs.communityhealthtoolkit.org/core/overview/db-schema/#tasks).
