So apparently, the tag doesn't even exist for pymsteams, so i really hope someone can help me figure this out. What i'm trying to do is write a python script to run a query and to send the results via MS Teams. I'm able to successfully send a text from the python script via myTeamsMessage.text("Hello World") but not the results of my variable df
I've tried finding videos on YouTube, and browsing the web, but there only seems to be examples of sending text. Perhaps someone may know of a workaround? Or even better, an actual solution?
import pymsteams
import pyodbc
import pandas as pd
import numpy as np
conn = pyodbc.connect("Driver={ODBC Driver 17 for SQL Server};"
"Server=***-***-***.***.***.com;"
"Database=IA;"
"Trusted_Connection=no;"
"UID=***;"
"PWD=***")
query = "SELECT * FROM [IP].[dbo].[vFEP]"
df = pd.read_sql(query, conn)
myTeamsMessage =
pymsteams.connectorcard("https://outlook.office.com/webhook/***")
myTeamsMessage.text("Hello World")
myTeamsMessage.send()
# def sleeve(df):
# print(df)
# sleeve(df)
# myTeamsMessage =
# pymsteams.connectorcard("https://outlook.office.com/webhook/***")
# myTeamsMessage.text(sleeve(df))
# myTeamsMessage.send()
This is the error i'm receiving.
"pymsteams.TeamsWebhookException: Summary or Text is required."
What i'm hoping to accomplish is to have the results of the df be sent via MS Teams. Again, i'm able to send a text via "", but that's all i'm limited to. Any help is greatly appreciated. Thank you!