# Warn when using deprecated db-object appearance

**URL:** <https://forum.communityhealthtoolkit.org/t/warn-when-using-deprecated-db-object-appearance/4890>\
**Category:** Development\
**Tags:** forms\
**Created:** [April 22, 2025, 5:38am UTC](https://forum.communityhealthtoolkit.org/t/warn-when-using-deprecated-db-object-appearance/4890 "2025-04-22T05:38:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![apoorvapendse](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/apoorvapendse/32/3893_2.png) [@apoorvapendse](https://forum.communityhealthtoolkit.org/u/apoorvapendse)\
**Post date:** [April 22, 2025, 5:38am UTC](https://forum.communityhealthtoolkit.org/t/warn-when-using-deprecated-db-object-appearance/4890/1 "2025-04-22T05:38:08Z")

</div>

Hi, I’ve been working on [this cht-conf issue](https://github.com/medic/cht-conf/issues/502) filed by @jkuester.

Is this the expected outcome in terms of the deprecation warnings?

 ![image](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/c/c5e2806a99b1dc112a4be953c870c83af58de506.png)

On replacing _db-object_ appearance with _select-contact_:

 ![image](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/a/a8c6e3364d8f6a95bfa1d37bc03f3699c1e3537f.png)

Also, is this the best place to carry out such discussions or should I post questions in the issue thread/PR?  
Thanks.

---

<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:** [April 22, 2025, 8:44am UTC](https://forum.communityhealthtoolkit.org/t/warn-when-using-deprecated-db-object-appearance/4890/2 "2025-04-22T08:44:53Z")

</div>

Hi @apoorvapendse

Thanks for noticing this!  
The forum is the right place for … everything 🙂  
In this case, because it’s a specific code problem, we will open an issue in GitHub. Since this is about the default config, can you please open an issue in the [cht-core](https://github.com/medic/cht-core) repo and tag as a [default config](https://github.com/medic/cht-core/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22Config%3A%20ANC%20Reference%20(default)%22) bug?

Thanks a lot! Really appreciate your attention to this detail.

---

<div class="post-metadata">

**Author:** ![apoorvapendse](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/apoorvapendse/32/3893_2.png) [@apoorvapendse](https://forum.communityhealthtoolkit.org/u/apoorvapendse)\
**Post date:** [April 22, 2025, 8:57am UTC](https://forum.communityhealthtoolkit.org/t/warn-when-using-deprecated-db-object-appearance/4890/3 "2025-04-22T08:57:14Z")

</div>

Thanks @diana!  
Sorry for not providing context, but the issue I am working on aims to introduce this deprecation warning with the use of `db-object`, which wasn’t present earlier.  
The screenshot is meant to verify that the change works.

I’ll file an issue in `cht-core` and create a draft PR for the [mentioned issue](https://github.com/medic/cht-conf/issues/502) if the changes meet expectations.

---

<div class="post-metadata">

**Author:** ![jkuester](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/jkuester/32/806_2.png) [@jkuester](https://forum.communityhealthtoolkit.org/u/jkuester)\
**Post date:** [April 22, 2025, 12:56pm UTC](https://forum.communityhealthtoolkit.org/t/warn-when-using-deprecated-db-object-appearance/4890/4 "2025-04-22T12:56:32Z")

</div>

Hi @apoorvapendse! To echo what Diana said, the forum is always a good place to post things (especially if you are not sure where else they belong). That being said, for specific issues _that already existing in a repo_ it is fine to just add a comment to the issue thread in GitHub. That does help keep the conversation about the issue in a central place. (And, generally speaking folks are pretty responsive both here on the forum and on GitHub.)

* * *

> [@apoorvapendse](#):
>
> Is this the expected outcome in terms of the deprecation warnings?

Precisely! This looks to be working as desired! One thing I noticed from looking at your screenshots that I missed in the design of the initial issue is that the [warning header message](https://github.com/medic/cht-conf/blob/75a5c0658eb28de3c24d74cdc95b60d7e1b73e5f/src/lib/validation/form/deprecated-appearance.js#L57) is now inaccurate. Previously this code was only detecting `horizontal` or `compact`. Now that the validation is more generalized, can you update the warning header to be a more generic message:

```auto
`Form at ${xformPath} contains fields with a deprecated appearance. Please update the following:`

```

Once that is done and you have got the unit tests working, please raise a PR for this!

* * *

> [@apoorvapendse](#):
>
> I’ll file an issue in `cht-core` and create a draft PR for the [mentioned issue](https://github.com/medic/cht-conf/issues/502) if the changes meet expectations.

❤ This would also be super helpful! I suspect there are a number of forms in that `default` config that are still using the `db-object` appearance. It would be great to get these updated to the recommended configuration.

Just one tip when it comes to uplifting forms to use `select-contact`, you can find the docs [here](https://docs.communityhealthtoolkit.org/building/forms/configuring/form-inputs/#contact-selector). But basically for the form to work you will need to update both the `appearance` column (from `db-object` to `select-contact`) AND the `type` column. The type changes from `db:{{contact_type}}` to just be `string`. _Then_, you need to add an additional value in the `appearance` column (it is a space-separated list) that is `type-{{contact_type}}`. For example, if you start with:

| type | appearance |
| --- | --- |
| db:person | db-object |

This should be updated to:

| type | appearance |
| --- | --- |
| string | select-contact type-person |

---

<div class="post-metadata">

**Author:** ![apoorvapendse](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/apoorvapendse/32/3893_2.png) [@apoorvapendse](https://forum.communityhealthtoolkit.org/u/apoorvapendse)\
**Post date:** [April 22, 2025, 3:04pm UTC](https://forum.communityhealthtoolkit.org/t/warn-when-using-deprecated-db-object-appearance/4890/5 "2025-04-22T15:04:17Z")

</div>

Thanks for taking out the time to write such a detailed reply, I appreciate it.

I’ve opened a [PR](https://github.com/medic/cht-conf/pull/682) for this after going through your suggestion, would love to hear your initial thoughts.

I’ll open the follow-up issue on `cht-core` shortly.  
Would it be alright if I quote your observation on `type` in the issue description as I found it quite helpful.

Thanks again @jkuester and @diana!

---

<div class="post-metadata">

**Author:** ![jkuester](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/jkuester/32/806_2.png) [@jkuester](https://forum.communityhealthtoolkit.org/u/jkuester)\
**Post date:** [April 22, 2025, 3:53pm UTC](https://forum.communityhealthtoolkit.org/t/warn-when-using-deprecated-db-object-appearance/4890/6 "2025-04-22T15:53:32Z")

</div>

👍 Sounds good! I have added myself as a reviewer for that PR. (Should be able to go through it tomorrow.)

And yes, feel free to just copy that context I added about the `type` stuff and/or just include a link over to this thread.

---

<div class="post-metadata">

**Author:** ![apoorvapendse](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/apoorvapendse/32/3893_2.png) [@apoorvapendse](https://forum.communityhealthtoolkit.org/u/apoorvapendse)\
**Post date:** [April 22, 2025, 5:27pm UTC](https://forum.communityhealthtoolkit.org/t/warn-when-using-deprecated-db-object-appearance/4890/7 "2025-04-22T17:27:12Z")

</div>

Opened [Replace usage of `db-object` appearance with `select-contact` · Issue #9915 · medic/cht-core · GitHub](https://github.com/medic/cht-core/issues/9915)
