cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Aesculus123
Level: Powered On

Selecting information from Teams Attachment

I will start by saying I am new to Flow's so please be patient with me.

 

I have a webhook which tells my team when an AD account gets locked. I am trying to set up a flow to email us when we receive a message to this team.

 

The information I need is contained in the Team Message Attachment. I have found that I can turn this into an HTML Table and see the information but I need a way to pick this out and display it with out the left over data. I have been trying to extract the information but have been unsucessful perhaps I am just missing something, I am unable to select any of the data from the Create HTML Table.

 

I have also tried taking information directly from the Team Message attachment but cant find the correct to do this. So I currently have:

 

When a new channel message is added - Team/Channel

Create HTML table - Message attachments (columns automatic)

Send an Email - Output from Create HTML table

 

The Create HTML table flow creates a table with the following columns:

 

ID, ContentType, ContenUrl, Content, Name, thumbnailUrl.

 

The only information I am interested in is in Content. This is a sample of the contents, I have bolded the Values that will that I need and used Underline for the Column. 

{ "text": "<p>Display Name's account got locked out at Time</p>", "title": "Locked Out User - Notification", "sections": [ { "text": "", "facts": [ { "name": "Lockout Source:", "value": "<p>String</p>" }, { "name": "Lock-Out Timestamp:", "value": "<p>String</p>" }, { "name": "Locked Out:", "value": "<p>Boolean</p>" }, { "name": "Bad Password Count:", "value": "<p>Int</p>" }, { "name": "SamAccountName:", "value": "<p>String</p>" }, { "name": "Domain Controller:", "value": "<p>String</p>" } ], "title": "", "activityTitle": "<p>User</p>", "activitySubtitle": "", "activityText": "<p>Users's account was locked out at Time and may require additional assistance</p>", "activityImage": "URL", "markdown": true, "startGroup": false } ] }

 

Most of the info is useless so I would like to get:

Lockout source - String
Lock-Out Timestamp - String

Locked Out - Boolean

Bad Password Count - String

SamAccountName - String

Domain Controller - String

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Selecting information from Teams Attachment

Hi @Aesculus123,

 

You can use the following steps to get the attachment content:

Annotation 2019-10-16 131458.png

JSON schema:

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "id": {
                "type": "string"
            },
            "contentType": {
                "type": "string"
            },
            "contentUrl": {
                "type": "string"
            },
            "content": {},
            "name": {
                "type": "string"
            },
            "thumbnailUrl": {}
        },
        "required": [
            "id",
            "contentType",
            "contentUrl",
            "content",
            "name",
            "thumbnailUrl"
        ]
    }
}

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: Selecting information from Teams Attachment

Hi @Aesculus123,

 

You can use the following steps to get the attachment content:

Annotation 2019-10-16 131458.png

JSON schema:

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "id": {
                "type": "string"
            },
            "contentType": {
                "type": "string"
            },
            "contentUrl": {
                "type": "string"
            },
            "content": {},
            "name": {
                "type": "string"
            },
            "thumbnailUrl": {}
        },
        "required": [
            "id",
            "contentType",
            "contentUrl",
            "content",
            "name",
            "thumbnailUrl"
        ]
    }
}

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Aesculus123
Level: Powered On

Re: Selecting information from Teams Attachment

Thank you I managed to get this working by parsing multiple times its a bit messy but is working.

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons in April

Read the announcement for more information!

firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (3,915)