Hi @chrischambers5292, thank you very much for your comment/question! This is definitely a good/tricky question. In short, if we talk about a way to STRUCTURE, it really depends on how you structure your page and what is the goal of your page. if we talk about what is the best technically, then it is where the events appear. Below in this message I list 2 links to support you on this question. Example: If you go to the OOTB Knowledge Portal (/kb) and search for something, it will go to the "kb_search" page. URL like: /kb?id=kb_search&query=test And if you open the filters there, you will see that all the Knowledge widgets (e.g. Knowledge Result Sort, Knowledge keyword Suggestion, Knowledge Language Facet, and many others.. What do I mean here: the goal of the page is to provide a better experience to the end user with the search results, filtering and sorting. Everything could be done in one single Widget? Sure it could, but imagine the size of the widget if it would be like that!? Therefore, we can split the widgets into responsibilities (using the events listeners/broadcasters). Did it help you further? Please let me know :-) All the best and happy coding! Useful links: www.servicenow.com/community/now-platform-forum/how-do-i-identify-which-widget-emits-or-broadcasts-an-event-in/m-p/1226671/highlight/true#M168959 developer.servicenow.com/dev.do#!/learn/learning-plans/tokyo/servicenow_application_developer/app_store_learnv2_serviceportal_tokyo_exercise_emit_and_respond_to_events
Hey @kefistefi, thanks a lot for your comment! To be honest, so far I didn't have the need to use, but if you wish to do so, ServiceNow already has a widget dependency included by OOTB, i.e. the chart.js library is available. Here is the link: yourinstance.service-now.com/sp_dependency.do?sys_id=a7a8754347011200ba13a5554ee4905c Just replace the word "yourinstance" according to your instance name. All you need to do to use this library is to add a dependency to the widget. For that, you just need to open a portal widget in the backend, go to the related list "Dependency" and add the chart.js to there. Then, you can use the chart.js library inside of the code of your widget. Hope it helps! Happy coding!
more videos please! on service portal. The way you explain is so clear and concise.😇
Muito bom, Felipe. Que legal seus conteúdos, te conheci hoje, e estou muito feliz por te achar. Obrigado!
Simple and absolutely useful information, thank you
I want to make the RITM variables editable on Service Portal if the RITM is not approved yet. How to do it? Thanks
Awesome video. Can you do recommend way to have widgets interact with each other? Or state management of widget instances
Hi @chrischambers5292, thank you very much for your comment/question!
This is definitely a good/tricky question.
In short, if we talk about a way to STRUCTURE, it really depends on how you structure your page and what is the goal of your page.
if we talk about what is the best technically, then it is where the events appear.
Below in this message I list 2 links to support you on this question.
Example:
If you go to the OOTB Knowledge Portal (/kb) and search for something, it will go to the "kb_search" page.
URL like: /kb?id=kb_search&query=test
And if you open the filters there, you will see that all the Knowledge widgets (e.g. Knowledge Result Sort, Knowledge keyword Suggestion, Knowledge Language Facet, and many others..
What do I mean here: the goal of the page is to provide a better experience to the end user with the search results, filtering and sorting. Everything could be done in one single Widget? Sure it could, but imagine the size of the widget if it would be like that!?
Therefore, we can split the widgets into responsibilities (using the events listeners/broadcasters).
Did it help you further?
Please let me know :-)
All the best and happy coding!
Useful links:
www.servicenow.com/community/now-platform-forum/how-do-i-identify-which-widget-emits-or-broadcasts-an-event-in/m-p/1226671/highlight/true#M168959
developer.servicenow.com/dev.do#!/learn/learning-plans/tokyo/servicenow_application_developer/app_store_learnv2_serviceportal_tokyo_exercise_emit_and_respond_to_events
Thanks so much for the detailed reply. Helps a lot! @@itsmgroup
Please post more custom widgets
Please upload videos of custom widgets serving different requirements.
Do you ever use chart,js with widgets?
Hey @kefistefi, thanks a lot for your comment!
To be honest, so far I didn't have the need to use, but if you wish to do so, ServiceNow already has a widget dependency included by OOTB, i.e. the chart.js library is available.
Here is the link: yourinstance.service-now.com/sp_dependency.do?sys_id=a7a8754347011200ba13a5554ee4905c
Just replace the word "yourinstance" according to your instance name.
All you need to do to use this library is to add a dependency to the widget.
For that, you just need to open a portal widget in the backend, go to the related list "Dependency" and add the chart.js to there.
Then, you can use the chart.js library inside of the code of your widget.
Hope it helps!
Happy coding!
@@itsmgroup amazing advice, appreciate it 💪
Super