web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Send a message in Team...
Power Automate
Unanswered

Send a message in Teams using Power Automate - Custom Trigger

(0) ShareShare
ReportReport
Posted on by 56

Hello! Although I was able to find ample documentation on how to send a message in Teams using Power Automate (link below), the available triggers are too limiting. I would like to use my Status field as the trigger, as in, the flow triggers once when Status = "Completed."

 

Here are all the SharePoint triggers, which exclude the one I need:

dfmaxwell_0-1672868381114.png

And additionally, the Microsoft Learn article is based on When at Item Is Created or Modified:

Send a message in Teams using Power Automate - Power Automate | Microsoft Learn

 

How can I trigger the flow based on the value in the Status column?

 

Many thanks

Categories:
I have the same question (0)
  • Verified answer
    Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    To do that you would use the regular When an item is created or modified trigger in SharePoint, but add a trigger condition so it only fires if the status field is Completed.  Take a look at this article.

    Trigger MS Flow On Condition Based On Column's Value With SharePoint List (c-sharpcorner.com)

  • dfmaxwell Profile Picture
    56 on at

    Hello Sir, you made a marvelous suggestion -- that article is exactly what I was looking for, especially for using multiple conditions, it turns out the code is very simple.

     

    My last step will be to debug the 502 bad gateway that only occurs when I try to assign the Flow Bot to post the message. Post as: User works just fine. (Blown away by the unnecessary errors -- I am open to final suggestions).

     

    Thanks again

  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    Can you show the error you are struggling with?

  • dfmaxwell Profile Picture
    56 on at

    I hope the following output from the failed step (Post message in a chat or channel) may help explain. The source is DoD cloud and now I'm led to believe perhaps Flow Bot is not authorized in Army 365. The following is scrubbed of any identifying information. Many thanks again.

     

    {

      "error": {

        "code": 502,

        "source": "//**scrubbed url**//",

        "clientRequestId": "//**scrubbed id**",

        "message": "BadGateway",

        "innerError": {

          "error": {

            "code": "InternalServerError",

            "message": "Http request failed with unhandled exception of type 'ProcessSimpleDataException' and message: 'Failed to find the tenant region with error {\"ErrorCode\":\"CrossCloudRequestUnauthorized\",\"Message\":\"Cross cloud request unauthorized: Expected Cloud is Prod; however Tenant Id: //**scrubbed id**// Cloud is determined as DOD.\"} for tenantId //**scrubbed id**//, statusCode Unauthorized.'."

          }

        }

      }

    }

     

     

    The inputs leading to this error are as follows:

    {

        "host": {

            "connectionReferenceName": "shared_teams",

            "operationId": "PostMessageToConversation"

        },

        "parameters": {

            "poster": "Flow bot",

            "location": "Channel",

            "body/recipient/groupId": "//**scrubbed id**//",

            "body/recipient/channelId": "//**scrubbed id**//",

            "body/messageBody": "<p>***THIS IS A TEST***</p>"

        }

    }

  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    Based on the error it looks like you are trying to run a flow in a DOD cloud and post to a Team in a regular cloud.  Or the other way around.  You won't be able to do that.  Make sure the flow and the Team are both running in the same cloud.

  • dfmaxwell Profile Picture
    56 on at

    I was also able to reproduce the error in another IS.

     

    Key text in the output above: "Cloud is determined as DOD"

    Key text in the error I reproduced: "Cloud is determined as GOV"

     

    I'm strongly led to believe this is not going to work. Unless there is an actual error in the inputs that I could have overlooked.

  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    As I said, evidently the Teams you are trying to message aren't in the same cloud.  That isn't going to work.

  • dfmaxwell Profile Picture
    56 on at

    Thanks for the great advice, I think I follow. Not made easier by the fact that the dataset is still stored in a staging and test environment. But as I said I think I understand and can go about fixing this.

  • dfmaxwell Profile Picture
    56 on at

    Kudos, thanks again

  • dfmaxwell Profile Picture
    56 on at

    Hello again sir, I am still working through this issue.

     

    I am curious why, as I mentioned earlier, the flow works perfectly when "Post as: User" is selected, but "Post as: FlowBot" produces the error?

     

    By necessity, my SharePoint subsite was created (somewhat like a by-product) out of Teams -- that is, when you create a new team (in Teams), a corresponding SharePoint site is created; so now we have a Staging & Test SharePoint site, and a team (in Teams) corresponding to it. Other than that, it appears as though I'm approaching the SharePoint environment consistently, leading me to believe that I'm following your advice, but it is still not working.

     

    Thank you.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard