- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2024 07:55 AM
Hi,
We have to create static content block to use in dashboard as landing page, I want to get current logged in user in content block.
Trying in this way, here i am not able to get current logged in user.
Can some one help to get this done.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2024 10:53 PM
Hey @Mad3,
Have you considered using 'Dynamic Content' instead?
Not an expert on Jelly but something like below will work
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate object="true" var="jvar_name" jelly="true">
var jvar_name = gs.getUserName();
jvar_name;
</g:evaluate>
<p>Welcome, ${jvar_name}!</p>
</j:jelly>
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2024 09:25 PM
Hi @Mad3 ,
Setting default value on HTML field will not work as i have tired it. Mail script can work here but not sure why i did not work for you, Give a check on your mail script to see if it returns any value.
My Alternative suggestion would be :
This may require a customization were you have to create a custom field (or see if there is any custom field which you can use here) which you will set the default value to javascript:gs.getUserID(); and create a onload script to copy the value of custom field to the HTML Field with a prefix of HI + <GET USER DISPLAY VALUE>.
Use line breaks to create a space with solutiation and content !
This can work but needs to be tested with all scenarios... i hope this helps...
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2024 10:53 PM
Hey @Mad3,
Have you considered using 'Dynamic Content' instead?
Not an expert on Jelly but something like below will work
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate object="true" var="jvar_name" jelly="true">
var jvar_name = gs.getUserName();
jvar_name;
</g:evaluate>
<p>Welcome, ${jvar_name}!</p>
</j:jelly>
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2024 06:43 PM
Hi @James Chun ,
Thank you for the reply! It helped me.
How can we have announcement type of widget in content block. If possible please let me know.
and also can we have knowledge article inside the content block (like want to show 3 to 4 lines of KB and when click should redirect to kb page).