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

边栏推荐
猜你喜欢

HCIP第十四天
Causes of Mysql Disk Holes and Several Ways to Rebuild Tables

21天打卡挑战学习MySQL——《Window下安装MySql》第一周 第三篇

亿流量大考(2):开发一套高容错分布式系统

Embedded systems: overview

node连接mysql数据库报错:Client does not support authentication protocol requested by server

Teach a Man How to Fish - How to Query the Properties of Any SAP UI5 Control by Yourself Documentation and Technical Implementation Details Demo

物联网新零售模式,引领购物新潮流

【刷题篇】二叉树的右视图

Go开发工具GoLand V2022.2 来了——Go 工作区重大升级
随机推荐
488. Zuma Game
pikachu Over permission
HCIP第十三天
386. Lexicographical Numbers
伴随着元宇宙、web3.0等概念的兴起,数字人、数字场景等诸多数字化的形态开始出现
HCIP第十六天
utils 定时器
[b01lers2020]Life on Mars
工作小计 QT打包
RPA助力商超订单自动化!
如何基于WPF写一款数据库文档管理工具(二)
投资性大于游戏性 NFT游戏到底是不是门好生意
Golang第二章:程序结构
Basic Concepts of Graphs
The sword refers to the offer question 22 - the Kth node from the bottom in the linked list
Conditional Statements for Shell Programming
466. Count The Repetitions
数据一致性:双删为什么要延时?
【刷题篇】二叉树的右视图
嵌入式系统:时钟