当前位置:网站首页>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效果如下:

边栏推荐
- Internet user account information management regulations come into effect today: must crack down on account trading and gray products
- [N1CTF 2018] eating_cms
- 382. Linked List Random Node
- 【day1】
- 全球观之地理部分
- 386. Lexicographical Numbers
- HDU 5655 CA Loves Stick
- Cisco ike2 IPSec配置
- 2022的七夕,奉上7个精美的表白代码,同时教大家快速改源码自用
- 静态文件快速建站
猜你喜欢
随机推荐
466. Count The Repetitions
Bytebase数据库 Schema 变更管理工具
for loop exercises
【day1】
21天打卡挑战学习MySQL—Day第一周 第一篇
Go开发工具GoLand V2022.2 来了——Go 工作区重大升级
navicat 连接 mongodb 报错[13][Unauthorized] command listDatabases requires authentication
云计算国内外发展现状
.NET6之MiniAPI(十四):跨域CORS(上)
Embedded systems: overview
2022的七夕,奉上7个精美的表白代码,同时教大家快速改源码自用
Flink--Join以及Flink函数
Teach a Man How to Fish - How to Query the Properties of Any SAP UI5 Control by Yourself Documentation and Technical Implementation Details Demo
pikachu Over permission 越权
The sword refers to the offer question 22 - the Kth node from the bottom in the linked list
2022-08-03 Oracle executes slow SQL-Q17 comparison
如何设计 DAO 的 PoW 评判标准 并平衡不可能三角
藏宝计划TreasureProject(TPC)系统模式开发技术原理
关于IDO预售系统开发技术讲解丨浅谈IDO预售合约系统开发原理分析
483. Smallest Good Base








