Hi, I'm trying to use environment variables to pass in a Teams group ID and channel ID to post a message in Teams on a button click. I have the following in my OnSelect function:
MicrosoftTeams.PostMessageToChannelV3(
LookUp('Environment Variable Values', 'Environment Variable Definition'.'Display Name' = "TeamsGroupID").Value,
LookUp('Environment Variable Values', 'Environment Variable Definition'.'Display Name' = "TeamsChannelID").Value,
{
content: "<ul>
<li>Type: " & DataCardValue17.Selected.Value & "</li>"
& If(Last(submittedDates).Date <> First(submittedDates).Date, "<li>Dates: " & First(submittedDates).Date & " to " & Last(submittedDates).Date, "<li>Date: " & First(submittedDates).Date) & "</li>
<li>What's Happening: " & DataCardValue6.Text & "</li>
</ul>",
contentType: "html"
},
{
subject: "Out of Office"
}
);
This snippet works just fine with I have the IDs hardcoded with quotes where I have the 2 env var lookups, but I get the following error when I try to use the env vars:
MicrosoftTeams.PostMessageToChannelV3 failed: {"error": {code": "BadRequest", "message"; "teamID needs to be a valid GUID.",...
Can anyone suggest how/if I can correctly pass in these values? I've tried with both quotes and no quotes around the ID values in my vars.
Thanks in advance.