英文:
How to send a SQL query output as a mail using PowerAutomate and ADF
问题
I have a task in which I want to send a SQL QUERY OUTPUT as mail body using Power Automate and ADF.
I am creating a Lookup activity in ADF where I am passing my query as:
select * from adventure table
where Animals = 'Lion' and Jungle = 'Amazon'.
this table is available in the SQL Database.
the output of the above query I want to send in the mail body not as a CSV attachment but as the mail body only in the form of a table so the third party can directly view the data in the mail only using Power Automate Flow. This flow should run every 1 hour daily.
Mail subject should look like:
FROM: People@gmail.com
TO: Linking@gmail.com
Subject: Animals Details
Hi XXXXX,
these are the animal details:
output of SQL query:
in table format
Thanks
Retailer
英文:
I have a task in which i want to send a SQL QUERY OUTPUT as mail body using Power Automate and ADF.
i am creating a Lookup activity in ADF where i am passing my query as:
select * from adventure table
where Animals = 'Lion' and Jungle = 'Amazon'.
this table is available in the SQL Database.
the output of the above query i want to send in mail body not as csv attachment but as mail body only in form of table so third party can directly view the data in mail only using Power Automate Flow. this flow should run in every 1 hour daily.
mail SUbject should look like:
FROM: People@gmail.com
TO : Linking@gmail.cok
Subject: Animals Details
Hi XXXXX,
these are the animal details :
output of SQL query:
in table format
Thanks
Retailer
答案1
得分: 1
以下是您可以尝试以满足您需求的方式。在查找活动后,我在Power Automate中使用了Web活动,并进行了如下的POST调用。
Body - @activity('Lookup1').output.value
在Power Automate中,流程可以结构化如下。
这是为示例数据生成的模式:
{
"items": {
"properties": {
"animal": {
"type": "string"
},
"id": {
"type": "integer"
}
},
"required": [
"id",
"animal"
],
"type": "object"
},
"type": "array"
}
示例数据:
[
{
"id": 1,
"animal": "Dog"
},
{
"id": 2,
"animal": "Cat"
},
{
"id": 3,
"animal": "Raccoon"
}
]
结果:
英文:
Below is something you can try to achieve your requirement. After the lookup activity, I used Web Activity and did a post call on power automate as below.
Body - @activity('Lookup1').output.value
Flow in power automate can be structured as below.
Here is the schema generated for the sample data
{
"items": {
"properties": {
"animal": {
"type": "string"
},
"id": {
"type": "integer"
}
},
"required": [
"id",
"animal"
],
"type": "object"
},
"type": "array"
}
sample data
[
{
"id": 1,
"animal": "Dog"
},
{
"id": 2,
"animal": "Cat"
},
{
"id": 3,
"animal": "Raccoon"
}
]
Results:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论