cancel
Showing results for 
Search instead for 
Did you mean: 

Graph Connectors (Outlook and Excel) Questions

john.hammond
Level 6
Afternoon all.

We're starting to experiment with Graph API and starting to get somewhere, particularly on the SharePoint side of things. Although I'm still having a few difficulties with some of the other connectors from the DX, and having searched for these issues I can't see them mentioned anywhere on these forums. Could just be me being extremely daft, but I was wondering if anyone could lend me a hand in understanding them a bit more:

 - In MS Graph - Outlook, I'm able to do most things, however the 'List Messages in Folder' action seems to only return a maximum of 10 items. I've seen similar responses in SharePoint, but that had a 'GetNextToken' output parameter which I could use, but I cannot see this here. Alternatively, there does appear to be the object 'List Messages' which does have a NextLinkToken output, however the format of the emails pulled using this object is nowhere near as pleasant as the other object - as in, the entire message with all headers and css/html tags are contained within a single string, making it difficult and inefficient to search, for example, a subject line.

 - With Excel, a bit of a more fundamental issue this one - how do you open a file?! I'm able to download a file, which I could then feasibly use the Excel VBO to do any manipulation that I require before uploading it again and deleting the old version, but this seems like a very haphazard way of going about things. I assume that I need to rub the object 'Create Session'? If so, could I have a bit more of a clearer explanation as to the Input Parameters needed to identify the relevant file? I assume that 'ID' is the Site ID with Workbook ID the ID of the Excel file itself (found via Get Drive Items in SharePoint)?

Many Thanks!

------------------------------
John Hammond
------------------------------
19 REPLIES 19

Hi @john.hammond,

The Newtonsoft JSON DLL should already be included in the Blue Prism Automate folder. Was there not one in yours?

Cheers,


------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

@john.hammond,

I think I may have misunderstood your question. Are you saying you needed to add Newtonsoft to the Global Code section? But you only had to do it when this one action was added, and it continued to work find with the other actions that used it? 🤔

Cheers,


------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Sorry @Eric Wilson, I'm not being particularly clear with my plethora of multiple questions. This issue relates to the Excel Connector for Graph. As of right now, I've not been able to get any functions working from this - whilst stepping through/over any stage within the Studio, I get the error message 'Internal : Unexpected error Cannot execute action "Create Session" because an error occurred while compiling custom code. Errors were found in the following locations: Shared code'​​. When looking at the Common Code on the API definition section in System, and checking this code, I get the following error message:
7343.png

------------------------------
John Hammond
------------------------------

@john.hammond,

That's interesting. I don't receive that error when I use the Graph connector for Excel. What version of Blue Prism are you on? It must be at least v6.4 otherwise you wouldn't be able to use WebAPIs. Regarding the .NET Framework version, you should be on at least some variant of v4 (ex v4.7) as that has been the base requirement of the BP platform for a while now. I don't think the software will even function if you only have .NET 3.5 installed.

Have you tried adding a reference to System.Core.dll to the Global Code options?

Cheers,​

------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Hi @Eric Wilson, thanks again for your response to this. Not sure if you saw this message regarding the output of the new and improved 'List Messages in Folder' action for Outlook API ​on the DX. Is there a way for the data to unpacked in a more readable manner/collection as it was previously?

Also, one other point - I noticed today that attachments have to be under a certain size to be sent using the Send Mail action (I tried sending a file which was around 6mb and received a HTTP error 419). I know that there is the chunking approach to uploading files larger than 4mb in SharePoint - is there something similar for email attachments?

------------------------------
John Hammond
------------------------------

Hi @john.hammond,

There was a reason we moved away from returning the nicer Collection that, as I recall, had to do with Microsoft including an element in their response information that wasn't always set. If it wasn't set when the Collection (aka DataTable) was initially created​, a data type exception could be raised if a subsequent record actually included a value. So we switched to just returning the raw JSON of the individual messages. You can then use the Utility - JSON VBO to turn it into something pretty.

We can go back and take another look at it to see if there's something else we might do with it.

Regarding attachments, Microsoft's Graph documentation states that attachments are limited to no more than 3MB when performing direct attach as part of the Send Message POST. That's what we currently support. There is an option to upload larger files (up to 150MB) by using upload sessions for attachments. We don't support that at the moment, but we'll get it in the backlog. For anything larger than 150MB, you'd probably have to create an upload session for OneDrive or SharePoint and then include the download URI of the file as the attachment in your email.

Cheers,

------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Hi again @Eric Wilson. Apologies for the delay, but have finally got around to testing this again - the compiler error has disappeared, however FYI, in the latest release of the Graph Upload Sessions object on the DX, the code stage contains reference to the following on Line 4:

long fileSize = new System.IO.FileInfo(@"C:\temp\3GB_TestFile.bin").Length;

I assume this is something that was used in testing?​

------------------------------
John Hammond
------------------------------

@john.hammond,

Oops! 😳 It's fixed.

Cheers,


------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Hi again @Eric Wilson. I'd just like to say thank you for your continued help and patience with trying to help me understand this! Added to my own lack of understanding, our Azure AD person is having some difficulty getting his head around this specific issue as well. When trying to create an Upload Session (or even use a regular upload using the SharePoint connector), I'm getting the following error message:

​{"error":{"code":"accessDenied","message":"Access denied","innerError":{"date":"2022-09-14T07:40:35","request-id":"31699107-cc04-4a22-84d4-c219fd950ec4","client-request-id":"31699107-cc04-4a22-84d4-c219fd950ec4"}}}

'Access Denied' is making me think that this is an AD-side issue, although apparently we have full Write access at the site level. Is there a specific permission that these actions require? The only other potential thing I can think that may be causing this is that the 'Auth Token' parameter requires a text data type, so just before the Create Upload Session action in my workflow I have a calculation that pulls the AccessToken password from the authenticator and writes it to a text data item. This then gets passed in. This is the correct way of doing this, right?
7366.png

------------------------------
John Hammond
------------------------------

Hi @john.hammond,

The Password​ data type in Blue Prism is nothing more than a Text item that only displays dots for characters. Under the hood, it's still regular text and that's the way the connector sees it. So there's no need to convert it.

See this page from Microsoft regarding upload sessions and Graph. It lists the required permissions based on the type of token you're using (Application vs Delegated).

https://docs.microsoft.com/en-us/graph/api/driveitem-createuploadsession?view=graph-rest-1.0

Cheers,



------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------