BP Screenshot issue

killerlince

New Member
Hi everyone, i have a process which blue prism search something from a Data base and if it doesnt finds a record it will update it with a screenshots of the new record. So i take the screenshot with BP, use a Data Item to store the Image, then i try to make a query to upload the image to a record with an attachment type. How can i attach the image in bp to the DataBase made in Access... I've work with everything BUT an attachment type record. Also i would like to know then if i can export the screenshot to an specific path or if there is a path or internal storage of the Blue Prism internal engine so i can use it to link it and upload it to my database. Or if anyone has a solution or suggestion to do this. Thank You
 

VJR

Well-Known Member
Hi killerlince,

For using the Attachment data type it (any document, image, etc), needs to be uploaded from the UI of Access and not from the SQL query. Since you are accessing via Blue Prism you can read about other issues that you may face here - https://www.cimaware.com/expert-zone/working-with-attachment-data-type-in-microsoft-access

There is an OLE Object datatype which can be used to store images in that field.
But a direct image cannot be stored. It has to be first converted to its corresponding binary data and then stored. Also the binary data has to be converted back to the original image while fetching the data back from the database.
You will have to write a code stage to achieve this functionality which you can do by taking pointers from the below link.
http://djjeavons.com/read-write-images-access-ole-object-field/

Using the above approach may have the possibilities to make your Access database larger depending on the number of records with images you have.

A better approach would be the one that you are thinking of. To store the image as a file on some path and then saving the path to the database. The below Code stage will help you achieve that.

Code:
Try

FullSavedImagePath = OutputFolderPath & Format(now, "dd-MMM-yy hh-mm-ss") & ".jpeg"
ImageToRead.Save(FullSavedImagePath, System.Drawing.Imaging.ImageFormat.jpeg)

Success = True

Catch e As Exception
    Success = False
    Message = e.Message
Finally

End Try

Overall Object Diagram:
1528094178442.png

Input Properties for Code stage:
1528094212200.png

Output Properties for Code stage:
1528094249469.png

Start stage properties:
1528094277271.png

End stage properties:
1528094326174.png

For any reference or namespace issues also take a look at this link.

- Pass the Image data item (which you already have) from the Process to this Object.
- Also pass the path where you want to store the resulting file.
- After running the process you will find the image stored as a separate file on the path that you passed in OutputFolderPath.
 
Last edited:

killerlince

New Member
How would you recomend to set up the image field or column in the database? its because i need it to read it someone make a manual correction using the image and then it will be erased because it has no use. Also i wanted to know how to set up the screen capture with coordinates or an area that i can set up, im not really familiar with that. I'm actually testing with the object you set up before in other post about how to configure the object to save the screen capture in a set up path, but i would like to modify it as i mentioned before, to save the coordinates or at least the top half of the screen because the other parts are useless to me.
 

VJR

Well-Known Member
Hi killerlince,

I have already mentioned the two possible datatypes for the image column in the above post (Attachments, OLE Object) and have also mentioned or pointed you to the caveats of using them.

Attachments doesn't seem to be an option since as stated above the doc or the image has to be uploaded from the Access UI.
If you would like to go with OLE Object then you will have to write a Code stage to store the image as binary data and back from binary to image and there could be resources available on the web one of which I have pointed out to you.

The code I have provided to you above is for saving an image to a physical path on the disk which was one of the considerations you made for this scenario you are working on. Didn't hear back from you about that.

You can also consider the possibility of sending an email via Blue Prism to the other person with that image file as an attachment taken directly from its path and once the email is sent the image on that path can be deleted if as you said it is no longer of any use.

For the need of a provision to capture screenshots based on co-ordinates, I have added a new code in the post below.
http://rpaforum.net/threads/procedu...e-in-data-item-using-blue-prism.862/post-4250
 

killerlince

New Member
Well i'm currently checking out how to code the ole object, so im trying to pass to binary the image then in Access in the form imagebox, ill set up the reader for binary data.
The process is this way: 1. the bot has to access a UI to pick up some data and fetch a value from an Access Data base, when the bot doesnt find a value it will simply store the data in a pivot table with an image (capture), then an user manually can read the image and set up the correct code, upload to the main table in the access database. So i need the blue prism to upload the image it picks up from the UI and with the fields store it into a pivot table in the data base for user directly interact with it throught a form. After the person sets every record accordingly pressess a button and upload to main data base, erase the temporary images stored for view purposes and ends. So basically my issue here is the uploading part of the object. And thats pretty much it
 
Top