Discover how to integrate Automation Anywhere’s RPA technology with ABBYY’s OCR software, ABBYY FlexiCapture.
Hello. Today I’d like to show you a video of how we integrate Automation Anywhere with ABBYY FlexiCapture. The combination of these two tools gives us a really unique advantage in using a best in class RPA through Automation Anywhere, and a best in class OCR technology through ABBYY. And it’s actually a pretty simple integration, just a few steps to walk through. So what I have in front of us is a bot. It’s just an automation bot. And the purpose of this bot is to call the ABBYY Web Service API. Now the ABBYY Web Service API is very advanced. A lot of cool unique methods in there that we can call and customize our document capture workflow. But you can see here, it’s actually fairly simple, at least in the way that I’m interacting here with this bot.
What we’re going to do is we’re going to open a session. We’re going to open a batch. We’re going to pass it a file. We’re going to close a batch and then we’ll tell the software to process a batch. So it’s actually quite simple. Now before I go into a few of these steps and describe kind of our approach here, let me just run the bot. And the purpose of the bot here is to make sure that we pass a document into this batch. So right now there are zero documents and zero pages. We’re going to pass a document in here and the software will automatically process it. I’ll go back to our bot and I’ll hit run. When I do this, the software will perform those series of API calls. And when it’s done, we will have a batch within FlexiCapture that has pages. I’m going to just go ahead and refresh my screen. You can see now the software is Processing, and now it’s in Verification. Now that I’m in Verification, I have a document that’s been passed in to ABBYY for further OCR processing. So that’s kind of the idea of the bot.
Let’s go into some of the specifics of how we make this happen. First off architecturally, we use the Web Service API, like I already shared. It’s very powerful, gives us just a ton of flexibility in the way that we process documents. But one of the more important ways that we interact with the API is everything uses what we call a “session”. So if I expand our session, you can see here, I have a REST Web Service activity where we’re going to post to a Web Service URL variable. Now it’s pretty simple. I’ll just show you mine. This is on my local system, so you can see the value there, but I’m going to post it. I have a couple of disabled steps here just to see some responses. And then we’re going to go ahead and extract the text. That text will tell us the “SessionId”. That SessionId is fairly critical to downstream processing. So it’s an important value that we want to keep, and we will store that in this SessionId variable. So then as we interact with the API going down, for example, I may want to open a batch. Well, when I open a batch, we have to send the Web Service API here in value step number 10. In this post, we have to send a series of Json. So in order to do that, you can see here what I’ve done is I have stored our Json in a variable called “Open Batch”. So if I look at our Open Batch, you can see here, I have my Json here.
Now, a couple of interesting parts of this Json that you’ll see is there’s a “sessionid” and a “batchid”. Once again, these are other values that have been provided either by other steps or by other variables. And so we need to populate those values in our Automation Anywhere workflow. And the way that we’ve done, at least for this demo today is we just simply use a “String: Replace”. So you can see here, we’re going to go take that Json. We’re going to go look for this kind of flag of the variable, and we’re going to populate it with another variable that was populated from another step. And so that’s how we replace that sessionid and batchid so that when we have our Json, and we post it, then we have the ability to pass in those variables with the proper values.
The only other thing I’ll mention is that every time we made a Json call, we want a Json response and the way that we do that is, we have a dictionary. You can see here, this is my open batch response. And within that response, we have the ability to store that here at the post. Now, anytime I want to reference that response, say, I want to maybe do some debugging, or I want to use a value from that response. You can see here that now we can populate that dictionary with what we call a “Body” element of the Json. And that will give us the ability to see that Json in full from which we can then parse and do all sorts of fun things through the Json. So I’m a big fan of using the variables to your own benefit here using replacements and those sorts of things so that you can call the Web Service API and make life quite a bit easier on you.
The only other thing, I’ll mention here, just so you’re aware, there’s a couple of different ways that you can do it, but one of the ideas of integration with Automation Anywhere, is you’ve got to pass it a file that needs to be a base 64 image. And so what we’ve done in our demo here today is we have a little DLL that we’ve written. It’s like a three-line DLL. That’s very simple, but the purpose of this DLL is to take an image specifically a file. And take that file and create a base 64 string out of it, and then we store that string right here in this variable called “Base64Bytes”. And that’s what we will pass then to ABBYY, to ingest it and perform the extraction downstream. So a couple of hints there. There might be a couple of other ways that you may think how to do that, but this is actually a very simple way. It gives us a little bit of control and we actually wrote this DLL in .NET, but you have other. Python is out of the box with Automation Anywhere and of course you can implement other string extraction there to perform your file conversion over to base 64.
The only other thing I’ll mention here in this workflow. To wrap it up is we process the batch. And you can see here we are going to make sure our Json is pretty by giving it the information we need, so we have a couple of string replaces. We post it and then we do have a message box of the body here. That’s what makes this integration to ABBYY FlexiCapture so powerful is that it’s just Web Service Calls. It’s very clean. We can either use the software purely in the cloud. We can use it in a hybrid model or we can use it purely on premise. So the option here for web service interaction is really, really clean and a lot of different ways we can store the proper Json communications credentials within Automation Anywhere’s package to really make this a seamless interaction.
If you have any questions on this, please reach out. Thank you so much.