
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 09-12-2023 06:19 AM
I am new to the Robotic Process Automation (RPA) concept and I like learning by example so the #BuildWithRPA Challenge was a great opportunity for me to learn all about RPA.
First: a little about my learning process...
I learn best by seeing an example and watching walkthrough demos. For me, it beats reading through documentation.
In thinking about building an RPA for my own use cases, I thought about what I would have to replicate from the lab to get my own RPA bot working. For me, copying the lab and tweaking things a little bit at a time made more sense as a starting point for learning and implementation, instead of starting from scratch.
So, I started by replicating the lab in my PDI. Instead of automating a Badge Tool, I tried opening up a website, clicking on the search icon, and running a search on some text that came from my instance.
If, like me, you learn to implement new features by following an example then tweaking it bit by bit, then this post will help you apply and replicate some of what we learned in the challenge to our own PDI or instance.
Here are the things that are pre-built/pre-configured in the Lab that we would have to replicate for our own instance's bot
- Send Data to Robot button/UI Action:
This button creates the Work Queue Item [sn_rpa_fdn_work_queue_item] that the bot would pick up. This Work Queue Item contains the data for the bot to use as a JSON payload in its Request Content field.
If I were building this for my own RPA/robot, I would label this something more user friendly like “Auto Print Badge” or something like that. The label could be different depending on your bot’s use case.
Let’s break this down because this UI Action consists of 2 additional configs that we will need to replicate.
First, let’s look at the UI action code:
Note that the UI Action calls a subflow.(function() { try { var inputs = {}; inputs['visitor_data_record'] = current; // GlideRecord of table: x_snc_visitor_ma_1_visitor // Execute Synchronously: Run in foreground. Code snippet has access to outputs. var result = sn_fd.FlowAPI.getRunner().subflow('x_snc_visitor_ma_1.send_visitor_data_to_robot_queue').inForeground().withInputs(inputs).run(); var outputs = result.getOutputs(); // Current subflow has no outputs defined. } catch (ex) { var message = ex.getMessage(); gs.error(message); } })();
So, we’ll also need to replicate the subflow… - The subflow takes the record in question as an input:
And has two actions, the first of which is a custom action and the second is an out-of-box (OOB) action that is ready for us to use. - The action takes the record in question as input:
- We also have to create the Bot Process Configuration [sn_rpa_fdn_bot_process_config] record and then connect that Bot Process Configuration with the Work Queue by via a Process Queue [sn_rpa_fdn_m2m_process_queue] record.
This is to replicate the Setup RPA Hub and Unattended Robot steps of the lab. Note that in the lab, the Visitor Bot Config is ready to be selected when you select Assign Configuration.
To create the Bot Process Configuration [sn_rpa_fdn_bot_process_config] record and connect it with the Work Queue by via a Process Queue [sn_rpa_fdn_m2m_process_queue] record, see the instructions in the official docs: https://docs.servicenow.com/bundle/vancouver-integrate-applications/page/product/rpa-hub/concept/cre... and ttps://docs.servicenow.com/bundle/vancouver-integrate-applications/page/product/rpa-hub/task/create-...
- We also need to create the user with the sn_rpa_fdn.rpa_robot role. The lab guide specifically says this user has been created in our lab instance.
When I tried basic authentication with the user I created on my PDI, I found that I couldn’t authenticate and had to set the sn_rpa_fdn.instance_authentication System Property to ‘basic’.
And there you have it. If you did the lab, found it helpful, and are using it as a starting point to create your own automation, hopefully the above helped you get started.
If this post helped you, I would appreciate it if you marked it as 👍 helpful.
- 1,181 Views