- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2023 05:53 AM
Hi All,
We added u_knowledge_owner field to KB articles and its a reference field which retrieves full name and users email address. We are displaying this on the KB articles but I need to change the email address to say Knowledge Owner.
KB00XXXXX
Test - Application - SharePoint Test
17d ago17 days ago • 6 Views • Test User (test.user@test-company.com)
SharePoint Test
Should look like the below:
KB00XXXXX
Test - Application - SharePoint Test
17d ago17 days ago • 6 Views • Test User (Knowledge Owner)
SharePoint Test
How could this be achieved ? Maybe someone has done something similar and could share the code.
Many Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2023 10:50 PM
Hey @Eli7
From where you retrieve this value "Test User (test.user@test-company.com)", why don't you return the value as you'd like to? Then just binding that variable to the HTML tag.
Sample.
gr.getDisplayValue('u_knowledge_owner').replace(gr.u_knowledge_owner.email, gr.u_knowledge_owner.getLabel());
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2023 06:13 AM
Hi @Eli7 ,
Within widget in the HTML you need to replace the variable, the current variable is fetching the email id in that place replace it with variable which will contain user id. You can fetch the user id for the respective knowledge article from server script.
Please check and Mark Helpful and Correct if it really helps you.
Regards,
Mayur Shardul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2023 06:35 AM
Hi Mayr,
Thank you for your response but I added the user in the HTML to display • Test User (test.user@test-company.com) and the value is from the u_knowledge_owner field which I added to the server script. On the KB article its a reference field to user table with attributes: ref_ac_column=name;email and I cannot change that.
I was hoping it could be solved with manipulating the value ie. replace anything within the braces so it would show (Knowledge Owner) instead of email address.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2023 10:22 PM
Hi @Eli7 ,
Field attribute should not affect this on portal side. Can you share that line of code for HTML & Server script if possible, it will help to understand more.
Please check and Mark Helpful and Correct if it really helps you.
Regards,
Mayur Shardul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2023 10:50 PM
Hey @Eli7
From where you retrieve this value "Test User (test.user@test-company.com)", why don't you return the value as you'd like to? Then just binding that variable to the HTML tag.
Sample.
gr.getDisplayValue('u_knowledge_owner').replace(gr.u_knowledge_owner.email, gr.u_knowledge_owner.getLabel());
Cheers,
Tai Vu