Some PDIs are currently unavailable, and PDI actions are paused. View the latest updates here. Read More

Workspace - Auto-resize read only HTML field (now-record-html-editor) in Zurich/Yokohama

AishwaryaSB
Tera Contributor

Hi Everyone,

 

I'm working on a requirement where an HTML field is displayed in a Workspace Record Form in read-only mode.  I have verified the behavior in both Zurich and Yokohama release. The field is rendered using the out-of-the-box 'now-record-html-editor' component.

 

The dictionary attribute 'editor.height' successfully changes the display height. Our requirement is for the the HTML field to automatically resize based on its content, so users don't see a vertical scrollbar.

 

I'd like to know:

1) Is there any supported out-of-the-box configuration or dictionary attributes to enable auto-resizing of a read-only HTML field in Workspace?

2) Has anyone implemented this requirement without customizing the out-of-the-box Workspace component?

3)If there is no out-of-the-box support, is a Workspace customization (custom component or client customization) the recommended approach?

 

Any guidance or best practices would be greatly appreciated.

 

Thank you!

1 ACCEPTED SOLUTION

Hi @AishwaryaSB 

No mate, there's no OOTB way to do this in Workspace. The reason is that Workspace is built on a different technology stack and is primarily based on CSS for UI styling. HTML and JavaScript are handled differently in the backend, so making changes in Workspace requires customization.

Since this isn't supported out of the box, you'll need to customize it if that's the requirement. Also, if your goal is to display static text to users, let me know exactly what you're trying to achieve, and we can look at the best approach.

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG

****************************************************************************************************************

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron

@AishwaryaSB 

I don't think anything available OOTB for this

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

Dr Atul G- LNG
Tera Patron

Hi @AishwaryaSB 

No, this is not available out of the box. What is the use case for utilising it?

Also, the workspaces are not in native form, and the technology used in the backend is different from the native format. So understanding the use case might help us guide you better.

 
*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG

****************************************************************************************************************

Hi @Dr Atul G- LNG ,

 

Thank you for your response.

 

The HTML field contains formatted guidance/instructions and is dsplayed in the read only mode in Workspace. Some records have longer content, which results in a vertical scrollbar due to fixed display height.

 

The requirement is for the field to automatically expand based on the content so users can read the complete text without scrolling inside the field.

 

Since editor.height only supports a fixed height, I wanted to check whether there is any supported approach to achieve auto resizing in workspace. We generally prefer to stay with OOB functionality. I was considering whether a Workspace client customization could dynamically adjust the height, but i wanted to check if anyone has implemented a supported solution before exploring that approach.

Hi @AishwaryaSB 

No mate, there's no OOTB way to do this in Workspace. The reason is that Workspace is built on a different technology stack and is primarily based on CSS for UI styling. HTML and JavaScript are handled differently in the backend, so making changes in Workspace requires customization.

Since this isn't supported out of the box, you'll need to customize it if that's the requirement. Also, if your goal is to display static text to users, let me know exactly what you're trying to achieve, and we can look at the best approach.

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG

****************************************************************************************************************