当前位置:网站首页>Click the icon in Canvas App to generate PDF and save it to Dataverse
Click the icon in Canvas App to generate PDF and save it to Dataverse
2022-08-03 22:27:00 【51CTO】
我是微软Dynamics 365 & Power Platform方面的工程师/顾问罗勇,也是2015年7月到2018年6月连续三年Dynamics CRM/Business Solutions方面的微软最有价值专家(Microsoft MVP),欢迎关注我的微信公众号 MSFTDynamics365erLuoYong ,回复472或者20220803可方便获取本文,同时可以在第一间得到我发布的最新博文信息,follow me!
以前的文章 Dynamics 365触发Microsoft Flow自动生成PDFand send it as an attachment 写了通过Word Connector来生成PDF文件,Today's article goes a step further,Describes how to handle itPDF中的列表数据,I am here to show that the contact list of selected clients are all printed out.
Today's article starts withCanvas App为例进行演示,点击按钮调用Cloud Flow执行操作.
First I make firstWord模板,I will not repeat what I said in the previous blog post,Briefly describe how to deal with the following table,主要是参考 Intermediate | Flow of the week: Create PDF Invoices Using Word Templates with Microsoft Flow 文章.
Mainly list words,Only two lines are used,One line is the list title,The other row is sample data,After selecting this row of sample data,点击Ribbon功能区的Developer这个Tab下的Repeat Section Content Control.Then each column remains the same as any other placeholder,设置为Plain Text Content Control.

为了方便映射,The two names I have here are set as the logical names of the corresponding fieldsfullname和 emailaddress1 .

You also need to upload this template to Onedrive或者Onedrive for business上,我这里是上传到Onedrive上,如下图.到此,The preparation of the template is complete.

Then I'll handle itCanvas App中的工作,Add one to the record's view details interfacePDF document的图标(icon).

再点击左侧的Power Automate图标,然后点击 Create new flow 按钮.

The next job is to create a new oneFlow了.出来的界面如下,There is no template I need,所以我点击 Create from blank 按钮.

首先新增一个 Initialize variable的变量,这个变量的ValueClick from the dynamic window Ask in PowerApps,这就是这个Flowreceived fromCanvas App的参数.记得保存flow之前为flowPick a meaningful name,Auto-generated names are ugly.

Then it is to query the information of customers and their contacts below,I have talked about the method of querying child records based on parent records,请参考 Dynamics 365查询父实体并返回子实体信息的方法 .I'm only showing screenshots here.

下面就是添加 Word Online (Business) 这个Connector下面的 Populate a Microsoft Word template的Action.

前面这些placeholderAssignment to fields is simple,The assignment of the list needs to click on the mark marked below Switch to input entire array 按钮.

Then I use expressions outputs('Get_contact_info')?['body/contact_customer_accounts'] 为这个字段赋值,效果如下:

然后增加一个OneDrive for Business下面的Create file步骤,我的设置如下:

再增加一个Word Online (Business) 这个Connector下面的 Convert Word Document to PDF的Action.

我这里设置如下,The expression used is concat('/Outputs/客户_',variables('AccountId'),'.docx') .

再添加Microsoft Dataverse Connector下的 Upload a file or an image 这个action.

我这里设置如下:
Content name The expression used is concat('客户_',variables('AccountId'),'.pdf')

Add one more final step,那就是PowerApps这个Connector下的 Respond to a PowerApp or flow,这是Canvas App调用flowrequired last step.

The last step is to generatePDF的图标的OnSelectThe code for the event execution is changed to the following:

Generated after clicking to testpdf效果如下:

边栏推荐
猜你喜欢

Recognized by International Authorities | Yunzhuang Technology was selected in "RPA Global Market Pattern Report, Q3 2022"

Summary bug 】 【 Elipse garbled solution project code in Chinese!

for循环练习题

On the Qixi Festival of 2022, I will offer 7 exquisite confession codes, and at the same time teach you to quickly change the source code for your own use

113. 授人以渔 - 如何自行查询任意 SAP UI5 控件属性的文档和技术实现细节

嵌入式系统:时钟

VLAN实验

Cisco ike2 IPSec configuration

中国企业构建边缘计算解决方案的最佳实践
Causes of Mysql Disk Holes and Several Ways to Rebuild Tables
随机推荐
CAS: 773888-45-2_BIOTIN ALKYNE_Biotin-alkynyl
嵌入式系统:时钟
Research status of target detection at home and abroad
HDU 5655 CA Loves Stick
October 2019 Twice SQL Injection
Golang Chapter 1: Getting Started
2019年10月SQL注入的两倍
pikachu Over permission 越权
Internet user account information management regulations come into effect today: must crack down on account trading and gray products
UVa 437 - The Tower of Babylon(白书)
Recognized by International Authorities | Yunzhuang Technology was selected in "RPA Global Market Pattern Report, Q3 2022"
《数字经济全景白皮书》金融数字用户篇 重磅发布!
Embedded systems: overview
488. Zuma Game
PowerMockup 4.3.4::::Crack
九种方式,教你读取 resources 目录下的文件路径
Conditional Statements for Shell Programming
utlis 线程池
数据一致性:双删为什么要延时?
Teach a Man How to Fish - How to Query the Properties of Any SAP UI5 Control by Yourself Documentation and Technical Implementation Details Demo