Is there a way to clone a widget from one instance into another?

Maxwell3
Kilo Guru

Hello all,

Is there a way to clone the widget from one instance into another? When I drag the 'announcement' widget onto my page, i cannot see the widget in 'edit' mode but in 'preview' mode all I see is this: {{::c.options.title}}, where the widget is supposed to be. I have two instances, on my other instance the widget works fine. I tried to copy and paste the HTML, CSS, Client Script and Server Script from the working widget into a cloned widget into my other instance, but it still does not display. 

Is there some other issue that I should be more concerned about? I really need this widget to function properly on this instance.

4 REPLIES 4

SanjivMeher
Kilo Patron
Kilo Patron

 

 

See if dependencies are added to the widget. Also you can take an export XML from the other instance and import it.

 

find_real_file.png


Please mark this response as correct or helpful if it assisted you with your question.

Maxwell3
Kilo Guru

Thank you for the reply Sanjiv, I checked the dependencies and I added 'Angular-ellipsis' to the widget. I could try importing and exporting the widget. I am having the same issue another widget as well, could it be a setting in the instance? When I drag and drop the widgets into the page in edit mode, the widgets are not visible and they are uneditable, but when I go into preview mode, this is what I see. I have copy/pasted the code from my other instance and I still get the same errors.

find_real_file.png

You need to check the widget HTML. I think you also need to pass some input to it to make it work


Please mark this response as correct or helpful if it assisted you with your question.

ad1000
Kilo Contributor

Hi Vutana,

Not sure if you were able to resolve your issue; I had a similar problem with copying/pasting all of the widget elements HTML, CSS, Client & Server Script + Angular dependencies, Angular Templates.

My issue was that I created the new widget in a completely different Application scope from my original.

This is a hint you should check out your scope:

             When I drag and drop the widgets into the page in edit mode, the widgets are not visible and they are uneditable, but               when I go into preview mode, this is what I see. I have copy/pasted the code from my other instance and I still get the same                     errors.

    find_real_file.png

Once I changed my scope to the correct application for the Service Portal widget I was attempting to edit; my edits were saved.

Here's a link to ServiceNow's product documentation if you need to search for how to change your scope: https://docs.servicenow.com/

All the best!