User view

It is possible to create a section to display the users in Portrait. These could be used when you want to expose the users to non admin accounts or to link them with an Entry to allow the selection of users in Form Dialog. However, there are also Limitations

The user view only supports the view-type List.

To activate the section and autofill it simply create a section called portrait-users .

The following columns are available:

  • id

  • username

  • email

  • role

  • status

A full configuration could look like this:

section: - name: portrait-users group: Users caption: Portrait Users type: list description: | Overview of the Portrait Users columns: - label: 'ID' key: 'id' type: 'string' showInTableHeader: false showInDetailList: true - label: 'Name' key: 'username' type: 'string' showInTableHeader: true showInDetailList: true - label: 'Email' key: 'email' type: 'string' showInTableHeader: true showInDetailList: true - label: 'Role' key: 'role' type: 'string' showInTableHeader: false showInDetailList: true - label: 'Status' key: 'status' type: 'string' showInTableHeader: false showInDetailList: true

The section can then be used in an EntryField for Forms

"fields": [ { "name": "Contact", "displayText": "Contact", "description": "Select a contact", "type": "Entry", "options": { "sectionId": "portrait-users", "primaryFieldKey": "username", "secondaryFieldKey": "email" } }, { "name": "ContactRole", "displayText": "Role of the contact", "type": "EntryField", "options": { "parentFormField": "Contact", "entryFieldKey": "role" } } ]

Additional Infos

In case you want to change the reserved name portrait-users, you can rename it in the applicationConstants Property. Remember to also rename the section.

application: applicationConstants: reservedUserSection: portait-benutzer ... section: - name: portait-benutzer group: Users forms: ... "fields": [ { "name": "Contact", "displayText": "Contact", "description": "Select a contact", "type": "Entry", "options": { "sectionId": "portrait-users", "primaryFieldKey": "username", "secondaryFieldKey": "email" } }, { "name": "ContactRole", "displayText": "Role of the contact", "type": "EntryField", "options": { "parentFormField": "Contact", "entryFieldKey": "role" } } ]

Limitations

Since the user-data is a data supplier without a specified source, the following restrictions apply.

Exposed Data

If you use the user-data for section, all user data is exposed to the frontend.

Search

The search function is limited to exact matches. Examples:

name: Max Mustermann
”Max”, “Muster”
“max”, “Muster*”

Push Notifications

Push Notifications are not supported on this section. Users can subscribe, however there will not be send an notification once an user or the section is updated.

Favorites

Favorites / add to dashboard is not supported.

Copyright Treskon GmbH.