For this post, I used to use Power Automate to do this but wanted a more straight forward way.
I luckily have bumped with Hiro(@mofumofu_dance) Blog which helped get on the function quickly. I’m posting it here on my blog as a personal reference.
If ever you there, dear stranger, have also had difficulty implementing it maybe start first with Shane Young and Reza’s blog to get to know about ParseJSON and Microsoft Teams Connector.
Original Post from Hiro(@mofumofu_dance)
Watch these two videos to learn about Parsing JSON and Retrieving your desired TeamsChannel.
and by the way, to create adaptive card designs:
Start Here: Microsoft Learn
And design here: https://adaptivecards.io/designer/
MicrosoftTeams.PostCardToConversation (string poster, string location, DynamicPostCardRequest body)
For Location: “Channel” | “Group chat” | “Chat with Flow bot”
Sample code from Hiro(@mofumofu_dance), this code only works if you are trying to post for a Teams Channel.
This is the code that must be added to Label3.Text.