customFields added via REST-API are not displayed to other users
It is related to issue #2304
click on the user details in group or channel or dialog you will see customField
you art not seeing the customField
none at the moment
@marco-aa I'm working on this issue and will make a PR soon. I have two questions:
1 - All custom fields should be shown? By now, I've created an admin field (Accounts => Custom Fields to Show in User Info) that must be filled with a list of custom fields to show. I'd like to hear people's opinion about it.
2 - I'm not sure how useful would be to have the possibility to render a label just before the custom field value. Again, would love to hear from other people. For instance, if I fill the "Custom Fields to Show in User Info" field with '[{"Lota莽茫o":"#{secao-descricao} (#{secao-sigla})"}, "secao-telefone"]', the following content will be rendered in the user details (after all other stuff):
Lota莽茫o: Se莽茫o de Sistemas Corporativos de TIC (ssci.citic)
(19)3420-1021
Dear @goiaba thanks for your information,
at 1) I think its great / good if we can diside wich field will be shown - example we store some private infromation and a public finfromation in customFields - so we can deside wich we will show, It's more flexible in this way.
It came into my mind - how the custom field content will be view/rendered - example text vs exmail vs url. Url, Email should be click-able ;) This brings me to your point 2) i think i would be usefull.
Maybe we can handle this like custom-css in the admin settting. We define like you suggested labe,displayformat,field to show.
@MartinSchoeler should we add new-feature label ? not sure because of the discussion with @goiaba about how to implement his functions...
@marco-aa For simplicity, my idea was to follow the other fields behavior that are all rendered as text (emails, for instance).
@goiaba of course - maybe in a second step we can change this to some kind of formating ...
I ask myself - what will happen if inside the text we add html-tags this could be a kind of ugly work around for the first step ;)
Use this syntax to display custom fields in profile
http://rocketchat/admin/Accounts
Custom Fields to Show in User Info >>
[{"Designation": "designation"}, {"Department": "department"}]
Registration >> Custom Fields
sample json format for add custom fields
{
"designation": {"type": "text",
"required": false,
"minLength": 2,
"maxLength": 100},
"department": {"type": "text",
"required": false,
"minLength": 2,
"maxLength": 100}
}
To update custom fields though Rest API
"data": {"name": name, "email": email, "customFields": {"designation": 'Artist', 'department': 'Modeling'}}}
The issue is that this is not documented, especially the "Custom Fields to Show in User Info" part.
I've created a PR for it: https://github.com/RocketChat/docs/pull/1174
@vfxpandit It works!
Most helpful comment
Use this syntax to display custom fields in profile
http://rocketchat/admin/Accounts
Custom Fields to Show in User Info >>
[{"Designation": "designation"}, {"Department": "department"}]
Registration >> Custom Fields
sample json format for add custom fields
To update custom fields though Rest API
"data": {"name": name, "email": email, "customFields": {"designation": 'Artist', 'department': 'Modeling'}}}