cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
VilPel
Super User
Super User

Not able to collect the whole custom connector response in a Power Apps collection

Hello guys,

 

This might be a lengthy post but I'm trying explain the situation as well as possible so some could give me a helping hand...

 

So, I've created a custom connector in Power Apps where I'm trying to fetch all replies to a specific channel message in Teams. The request URL looks like this and I'm passing the 3 parameters to the request from Power Apps.

Screenshot 2022-07-02 114830.png

 

Everything works very well when testing the connector in the "Custom connectors" and I'm happy with the response body that the connector gives me. Here is the response I'm getting for 3 channel replies:

{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#teams('e0086573-5e3c-4cc7-98ed-57af9db4b51c')/channels('19%3A3c7a155d3523482983ee9a3a8c7c8556%40thread.tacv2')/messages('1656751916142')/replies",
  "@odata.count": 3,
  "value": [
    {
      "id": "1656752005398",
      "replyToId": "1656751916142",
      "etag": "1656752005398",
      "messageType": "message",
      "createdDateTime": "2022-07-02T08:53:25.398Z",
      "lastModifiedDateTime": "2022-07-02T08:53:25.398Z",
      "lastEditedDateTime": null,
      "deletedDateTime": null,
      "subject": null,
      "summary": null,
      "chatId": null,
      "importance": "normal",
      "locale": "en-us",
      "webUrl": "https://teams.microsoft.com/l/message/19%3A3c7a155d3523482983ee9a3a8c7c8556%40thread.tacv2/1656752005398?groupId=e0086573-5e3c-4cc7-98ed-57af9db4b51c&tenantId=25afa114-133e-4411-9fa7-8b1602925e0d&createdTime=1656752005398&parentMessageId=1656751916142",
      "policyViolation": null,
      "eventDetail": null,
      "from": {
        "application": null,
        "device": null,
        "user": {
          "id": "aec34cd7-811a-487b-8eb3-93e8bc475583",
          "displayName": "Ville Pellosniemi",
          "userIdentityType": "aadUser"
        }
      },
      "body": {
        "contentType": "text",
        "content": "3rd reply"
      },
      "channelIdentity": {
        "teamId": "e0086573-5e3c-4cc7-98ed-57af9db4b51c",
        "channelId": "19:3c7a155d3523482983ee9a3a8c7c8556@thread.tacv2"
      },
      "attachments": [],
      "mentions": [],
      "reactions": []
    },
    {
      "id": "1656751993825",
      "replyToId": "1656751916142",
      "etag": "1656751993825",
      "messageType": "message",
      "createdDateTime": "2022-07-02T08:53:13.825Z",
      "lastModifiedDateTime": "2022-07-02T08:53:13.825Z",
      "lastEditedDateTime": null,
      "deletedDateTime": null,
      "subject": null,
      "summary": null,
      "chatId": null,
      "importance": "normal",
      "locale": "en-us",
      "webUrl": "https://teams.microsoft.com/l/message/19%3A3c7a155d3523482983ee9a3a8c7c8556%40thread.tacv2/1656751993825?groupId=e0086573-5e3c-4cc7-98ed-57af9db4b51c&tenantId=25afa114-133e-4411-9fa7-8b1602925e0d&createdTime=1656751993825&parentMessageId=1656751916142",
      "policyViolation": null,
      "eventDetail": null,
      "from": {
        "application": null,
        "device": null,
        "user": {
          "id": "aec34cd7-811a-487b-8eb3-93e8bc475583",
          "displayName": "Ville Pellosniemi",
          "userIdentityType": "aadUser"
        }
      },
      "body": {
        "contentType": "text",
        "content": "Another reply to the post"
      },
      "channelIdentity": {
        "teamId": "e0086573-5e3c-4cc7-98ed-57af9db4b51c",
        "channelId": "19:3c7a155d3523482983ee9a3a8c7c8556@thread.tacv2"
      },
      "attachments": [],
      "mentions": [],
      "reactions": []
    },
    {
      "id": "1656751922896",
      "replyToId": "1656751916142",
      "etag": "1656751922896",
      "messageType": "message",
      "createdDateTime": "2022-07-02T08:52:02.896Z",
      "lastModifiedDateTime": "2022-07-02T08:52:02.896Z",
      "lastEditedDateTime": null,
      "deletedDateTime": null,
      "subject": null,
      "summary": null,
      "chatId": null,
      "importance": "normal",
      "locale": "en-us",
      "webUrl": "https://teams.microsoft.com/l/message/19%3A3c7a155d3523482983ee9a3a8c7c8556%40thread.tacv2/1656751922896?groupId=e0086573-5e3c-4cc7-98ed-57af9db4b51c&tenantId=25afa114-133e-4411-9fa7-8b1602925e0d&createdTime=1656751922896&parentMessageId=1656751916142",
      "policyViolation": null,
      "eventDetail": null,
      "from": {
        "application": null,
        "device": null,
        "user": {
          "id": "aec34cd7-811a-487b-8eb3-93e8bc475583",
          "displayName": "Ville Pellosniemi",
          "userIdentityType": "aadUser"
        }
      },
      "body": {
        "contentType": "text",
        "content": "Reply to example post"
      },
      "channelIdentity": {
        "teamId": "e0086573-5e3c-4cc7-98ed-57af9db4b51c",
        "channelId": "19:3c7a155d3523482983ee9a3a8c7c8556@thread.tacv2"
      },
      "attachments": [],
      "mentions": [],
      "reactions": []
    }
  ]
}

 

Now, Im trying to collect this response in Power Apps and display it in a gallery using a piece of code like this which also triggers the connector:

ClearCollect(
    colChannelMessageReplies,
    GraphAPI.GetChannelReplies(varGroupID, varChannelID, 1656751916142).value
);

 

The collection is created pretty neatly as you can see:

Screenshot 2022-07-02 115732.png

 

I am able to access the body of the messages with a simple code in a gallery such as ThisItem.body.content which displays the message body.

 

The problem I'm having is displaying information of the user who sent the message. I thought I am able to access this information by typing ThisItem.from.user.displayName in the gallery. With this action I'm getting an error of "Invalid use of '.'" after I type the "displayName".

 

I might know why this action doesn't give me the user information. When clicking the "from" -column in the Collection, it displays no information for any of the collection items:

Picture1222.png

 

I am fairly new working with custom connectors, could anyone help me solving this problem?

 

Thanks in advance!

 

Ville

1 REPLY 1
VilPel
Super User
Super User

I also found this now from the Connector editor:

Screenshot 2022-07-02 134438.png

 

Property ".value.Item.from.user" type mismatch, Expected: "object", Actual: "string".

 

Is there a fix for this?

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (1,498)