What does the 'known' field signify on the user-settings doc?

On user-settings docs there is sometimes a field called known. If the field exists, the value is always true. What is the purpose of this field?

{
    "_id": "org.couchdb.user:user123",
    "_rev": "3-b5e5a70715a9ea9b4aa3d2b123456789",
    "name": "user123",
    "type": "user-settings",
    "known": true,
    "roles": [
        "district-manager",
        "kujua_user",
        "data_entry",
        "district_admin"
    ],
    "language": "en",
    "contact_id": "e3368be4-2374-482d-8fb8-125123456789",
    "facility_id": "04aec372-5c88-430a-89f4-fae123456789"
}
2 Likes

Here’s the documentation on user-settings.

1 Like

The known field is used to record if this is the first time the user has logged in. Users are created with known: false and when they first log in, we show them the tour popup, and then set known: true so they’re not nagged to take the tour next time.

2 Likes

Is there a way to set known: true with medic-conf ... csv-to-docs upload-docs? This would be handy in cases where it is not desired to show the tour, or where users already have seen the tour in a training app. IIRC, csv-to-docs even creates json docs with the field, but this then gets “lost” during upload-docs.

As far as I can tell csv-to-docs won’t ignore any fields. You will need to ensure that the field value is bool:true so it gets parsed as a boolean not a string. Other than that it should work.

If you’re using the create-users function it will ignore the known field.

Please raise an issue in medic-conf if this isn’t working as expected!