@armino It's quite a process to return the information that you are looking for. Please note: The scope actions aren't necessary. However I use them in my flow so I can easily collapse groups of actions and keep things organized.
Get Message Details
You will need to add a Get Message Details action to your flow to return details from the posted message. Insert the Message ID dynamic content from the When a new channel message is added action.
Note: Compose actions aren't necessary—you can use the dynamic content directly in the other actions. However, to better illustrate what's going on in the flow, I'm using Compose actions.
I've added two Compose actions to store the Channel ID dynamic content and the Team ID dynamic content from the Get message details action.

As you can see, the Get message details action only returns IDs not the Team or Channel name. You will need to use the IDs to retrieve those from other actions.

Get a Team
Add a Get a team action. I've inserted the Compose action Outputs that is storing the Team ID.
This action will return all Team details. I've inserted a Compose action (optional) to the flow to store the Display Name of the Team.

Get the Channel
Power Automate doesn't have a List Channel action. You will need to use the List channels action. This action will return a list of all channels from your selected team.
You will need to use a Filter Array action to filter out the channel you are looking for by its ID. To learn more about how to use the Filter Array action, please refer to this recent YT Tutorial I uploaded.
In the From field, insert the Channel List dynamic content from the List Channels action above. In the first value field insert the Channel id dynamic content. Leave the operator as is equal to. In the second value field, insert the Outputs from the Compose action

Run a test.
Get the Channel Name
The Filter Array action will return an array of items even if it's a single item. In order to get the channel name you will need to use an expression. Refer to this section of the YT Tutorial I uploaded on how to get dynamic content from a Filter Array action.
All dynamic content can be accessed using the key. The key is the text in red between the double quotes. The channel name can be returned by using the DisplayName key.

Add a Compose action to your flow. Insert an expression. To return the dynamic content from this Filter Array action you need to start with this:
?[0]['']
Since you are only wanting to return a single channel name you need to access the first item in the array which can be done by using the item index: [0]

In between the single quotes enter the key for the dynamic content you want to return. To return the channel name use DisplayName. Make sure that you type it exactly as it appears in the Filter Array outputs.
Place your cursor at the beginning of the expression. Tip: Press the up arrow key. Insert the Body outputs from the Filter Array action.

Press Ok.

Hope this helps!
If I helped you solve your problem—please mark my post as a solution ✅. Consider giving me a 👍 if you liked my response!
|