How to use Get Record from Microsoft Teams activity with object type "Teams async operation"

During the past months I’ve been struggling to get certain Microsoft Teams related operations automated in Studio. I’ve been asking a lot in the help forum, trying alternative methods, and finally we (my organization) are in the position to start using native activities for accomplishing this tasks.

First of all, I want to clarify that we are going to use Integration Service Activities by UiPath package, which, to this moment, is on its v1.2.0 release, published on 1/29/2024.

WARNING: don’t use v.1.2.0 I realized while writing this they released on the 2/27/2024. IT HAS BROKEN FUNCTIONALITY, AS I ALREADY REPORTED.

This is important, because there’s a bunch of different Teams-related packages (like Microsoft Teams by UiPath, v5.0.5-previewplease avoid that one also! It will work quite similarly as this one, but I’ve been advised by UiPath team not to rely on it anymore) and the way UiPath manages its co-existence is, to me, very confusing, as you never know for sure which ones they are talking about when referring to the documentation (in case it exists), forum topic, which ones are currently being maintained, which ones are oudated, which ones work, which ones don’t work anymore… and the like. Not only happens with this activity but with a bunch of other ones. I had to double-confirm with UiPath staff, via tickets and forum questions, that THIS is THE RIGHT ONE.

So, all in all, when having that package installed, you’ll have a Microsoft Teams tree of activities, with the distinct purple Teams icon on the left of every activity. The one I’m explaining here is the Advanced → Get Record one, as provides extra functionality by interacting more directly with the Graph API that’s not available in the other native activies (the ones for creating channels, getting teams, sending chat messages and so) from this package.

So drag the activity in your project. Assure, in the Properties subwindow, that the name of the activity is UiPath.IntegrationService.Activities.Runtime.Activities.ConnectorActivity. They should make a reference to this in the docs to avoid any confusion, but they don’t do it.

Now you should search for the Advanced → Get Record activity in the Microsoft Teams tree of activities and drag it in your project. Not to say that you must have set up the proper connection before attempting any operation (the gear icon). Then select “Teams async operation” from the **Select object *** drop down.

Now the absurdly tricky part is the **URL *** field, as there was absolutely no info anywhere on the internet, not to say on the (non-existing) UiPath docs. I suspected from the beginning it was related to calling the Ms-Graph API (what else it could be?), but… in which format??

Calls directly to the API are in the form

GET https://graph.microsoft.com/v1.0/teams/whateverIDorUDorWhateverFromTheTeam

But using that format straightly would throw an obscure error. It was suggesting, thought, that something in the URL was not in the format it expected.

First I got rid of the “GET” part, but it didn’t work. The error kept complaining about the string having some “https” part or whatever it didn’t understand.

You know, now it might sound straightforward, but it took me a lot of testing. I even tried changing the graph.microsoft.com part to our organization’s, changing the v1.0 to beta or other versions, because I was not sure if that was the problem. I was even doubted that the string was the problem at all.

It took me hours to figure out that the right one is the one you see in the screenshot: you have to get rid of the GET https://graph.microsoft.com/v1.0 part.

No even UiPath was able to provide that answer: they told me merely to get rid of the “GET” part of the URL; that’s the response I got to my ticket after 6 h waiting.

After that, you’ll have your output variable of the “teams async operation” type you’ll have to mess with. They are saying somewhere that you should poll for its content, as it’s an async operation, no less than every 30 seconds. But that another matter.

Oh! If you are wondering what the kind of type of that output varible is:

That’s it. The yellow one. Studio doesn’t allow me to copy that text anywhere I try it, so I’m not bothering typing it. Do you think thats normal for a variable type? Me neither. And thankfully it showed up quickly in the list. Because this activity DOESN’T OFFER YOU THE OPTION TO CREATE THE VARIABLE (thus selecting the proper type for you) at that moment, as opposite to many other activies; you have to create it first, from the variable list or the data manager, and leaves you alone trying to figure out what the heck the type is gonna be. Thanks again, UiPath!!