New batch of ServiceNow macros creation request

Hello Team,
We just moved to Agent Workspace on ServiceNow and we are struggling to rewrite simple macros from iMacros.

Official documentation says the UI Macros will not be supported as per those are written in Jelly.

Would anyone be kind enough and help Us poor Service Desk monkeys automate their tedious work?

We are not sure in which this new Agent Workspace site language is written in, we assume ReactJS because iMacros are just not ‘grabbing’ those boxes/lists to populate.

Hi, can you post videos of the macro(s) running? This would give us here an idea what the macros actually do, and how to best convert them to Ui.Vision macros.

1 Like

Thank you for your response however as a new User I cannot add attachments. I’ll link a YT video in a moment.

Please refer to this YT video:

Nice video. It seems RPA works in principle. What goes wrong/where do you need help?

1 Like

It’s common that happens when you use Xtype.

I recommend you to add Xclick on each cell to find focus and slow down macro execution.

When using Xclick/Xtype it is good to have a medium-low speed because it is easy for errors to occur.

I also create desktop macros and I assure you that I spend a lot of time solving problems similar to yours, to move from one box to another you can use Xtype | ${KEY_TAB}

1 Like

Hey thank you newuserkantu for your response,
how to slow down macro execution?

I advise you not to use the images to recognize the various boxes, it is a slow and complicated method but to use the automatic text recognition, you will find here the OCR commands that are much simpler and faster to use without using images that have the limit that they change resolution not are recognized.

https://ui.vision/rpa/docs/xclick#xclicktext

To slow speed macro you can use at the start of code of macro this code with options

SLOW
MEDIUM
FAST
NODISPLAY

    {
      "Command": "store",
      "Target": "SLOW",
      "Value": "!REPLAYSPEED",
      "Description": ""
    },

Hi,

Keep in mind that new ServiceNow User interface called “Tokyo-release”, uses shadow-root (open) (Xpath shadow-root) from the very top of their HTML code. Kantu at this point does not support “shadow-root (open) (Xpath shadow-root)” and therefore regular automations such as “Click” can’t be used anywhere on the entire page. You basically have to go with desktop automation such as Xclick and so on.

So when they roll that out in your company your old kantu scripts do not work anymore. Luckily for me, my company rolled the User interface back the older version in ServiceNow. But not sure how long I can keep it as it looses ServiceNow support at one point.

1 Like

OKay, I’ve almost finished desktop automation but I’ve reached maximum number of Xmodules used.

However I think I could double down on Type’s with your help.

Could anyone reviev my code?

I think I need 4-5 more XTypes to finish this:

{
  "Name": "SAP Password reset",
  "CreationDate": "2023-2-14",
  "Commands": [
    {
      "Command": "bringBrowserToForeground",
      "Target": "",
      "Value": "",
      "Description": "Edge to the foreground"
    },
    {
      "Command": "XClickRelative",
      "Target": "09890_dpi_96.png",
      "Value": "",
      "Description": "Locating unique element to relate to"
    },
    {
      "Command": "XType",
      "Target": "${KEY_TAB}${KEY_TAB}${KEY_TAB}${KEY_ENTER}",
      "Value": "",
      "Description": "Locating Category field"
    },
    {
      "Command": "XType",
      "Target": "${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}${KEY_ENTER}",
      "Value": "",
      "Description": "Choosing from the drop down list"
    },
    {
      "Command": "XType",
      "Target": "${KEY_TAB}${KEY_DOWN}${KEY_DOWN}",
      "Value": "",
      "Description": "Locating Subcategory"
    },
    {
      "Command": "XType",
      "Target": "${KEY_DOWN}${KEY_DOWN}${KEY_ENTER}",
      "Value": "",
      "Description": "Choosing form the drop down list"
    },
    {
      "Command": "XType",
      "Target": "${KEY_TAB}${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}",
      "Value": "",
      "Description": "Locating Type"
    },
    {
      "Command": "XType",
      "Target": "${KEY_DOWN}${KEY_DOWN}${KEY_ENTER}",
      "Value": "",
      "Description": "Choosing from the drop down list"
    },
    {
      "Command": "XType",
      "Target": "${KEY_TAB}${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}",
      "Value": "",
      "Description": "Locating Functional Criticality"
    },
    {
      "Command": "XType",
      "Target": "${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}${KEY_ENTER}",
      "Value": "",
      "Description": "Choosing from the drop down list"
    },
    {
      "Command": "XType",
      "Target": "${KEY_TAB}",
      "Value": "",
      "Description": "Locating Configuration Item"
    },
    {
      "Command": "XType",
      "Target": "SAP Console",
      "Value": "",
      "Description": "Populating Configuration Item"
    },
    {
      "Command": "XType",
      "Target": "${KEY_ENTER}",
      "Value": "",
      "Description": "Choosing from the drop down list"
    },
    {
      "Command": "XType",
      "Target": "${KEY_TAB}${KEY_TAB}",
      "Value": "",
      "Description": "Locating Channel"
    },
    {
      "Command": "XType",
      "Target": "${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}",
      "Value": "",
      "Description": "Choosing from the drop down list"
    },
    {
      "Command": "XType",
      "Target": "${KEY_ENTER}",
      "Value": "",
      "Description": "Choosing?"
    },
    {
      "Command": "XClickRelative",
      "Target": "3123_dpi_96.png",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "${KEY_ENTER}",
      "Value": "",
      "Description": "Choosing from the drop down list"
    },
    {
      "Command": "XType",
      "Target": "${KEY_TAB}",
      "Value": "",
      "Description": "Locating State"
    },
    {
      "Command": "XType",
      "Target": "${KEY_TAB}",
      "Value": "",
      "Description": "Locating Impact"
    },
    {
      "Command": "XType",
      "Target": "${KEY_TAB}${KEY_ENTER}",
      "Value": "",
      "Description": "Locating Urgency"
    },
    {
      "Command": "XType",
      "Target": "${KEY_UP}${KEY_UP}${KEY_ENTER}",
      "Value": "",
      "Description": "Choosing from the drop down list"
    },
    {
      "Command": "XType",
      "Target": "${KEY_TAB}",
      "Value": "",
      "Description": "Locating Priority"
    },
    {
      "Command": "sendKeys",
      "Target": "${KEY_TAB}",
      "Value": "",
      "Description": "Locating Assignment Group"
    },
    {
      "Command": "XType",
      "Target": "SNI Service Desk",
      "Value": "",
      "Description": "Populating Assignment Group"
    }
  ]
}

Also, running onto:
timeout reached when looking for element '${KEY_TAB}${KEY_TAB}${KEY_TAB}${KEY_TAB}${KEY_TAB}

How can I bypass this?

add this on top of code

 {
      "Command": "store",
      "Target": "true",
      "Value": "!errorignore",
      "Description": ""
    }
{
  "Name": "SAP PASSWORD RESET BY MATI",
  "CreationDate": "2023-2-14",
  "Commands": [
    {
      "Command": "bringBrowserToForeground",
      "Target": "",
      "Value": "",
      "Description": "Edge to the foreground"
    },
    {
      "Command": "XClickRelative",
      "Target": "Locator_dpi_96.png",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "Mateusz Dolas${KEY_ENTER}${KEY_TAB}${KEY_TAB}${KEY_TAB}${KEY_DOWN}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}${KEY_ENTER}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XClickRelative",
      "Target": "q2eq_dpi_96.png",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "${KEY_S}${KEY_ENTER}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XClickRelative",
      "Target": "q231_dpi_96.png",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "${KEY_S}${KEY_ENTER}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XClickRelative",
      "Target": "12_dpi_96.png",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "${KEY_C}${KEY_ENTER}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XClickRelative",
      "Target": "1323_dpi_96.png",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "SAP Console${KEY_ENTER}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XClickRelative",
      "Target": "11111_dpi_96.png",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "${KEY_C}${KEY_ENTER}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XClickRelative",
      "Target": "222222_dpi_96.png",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "SNI Service Desk${KEY_ENTER}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XClickRelative",
      "Target": "33333_dpi_96.png",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "Mateusz Dolas${KEY_ENTER}${KEY_TAB}${KEY_TAB}[SAP] - [password reset request]${KEY_TAB}User requested to reset their password in application [SAP SYSTEMNAME].  [ x ] Password has been reset successfully. [  ] Password hasn't been reset. Issues encountered: [type in issue name]",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "",
      "Target": "",
      "Value": "",
      "Description": ""
    }
  ]
}

This is my final code. It feels little bit coarse but it is all I can do for now.
Any improvements ideas for drop down list in ServiceNow to react faster?