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

边栏推荐
- Golang第二章:程序结构
- 113. Teach a Man how to fish - How to query the documentation and technical implementation details of any SAP UI5 control property by yourself
- 工作小计 QT打包
- 全球观之地理部分
- 为什么我们需要回调
- L2-029 特立独行的幸福
- Golang第一章:入门
- 【开源框架】国内首个通用云计算框架,任意程序都可做成云计算。
- .NET6之MiniAPI(十四):跨域CORS(上)
- LabVIEW code generation error 61056
猜你喜欢

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

HCIP第十六天

Cisco ike2 IPSec configuration

Embedded Systems: Clocks

.NET6之MiniAPI(十四):跨域CORS(上)

网络基础学习系列四(网络层,数据链路层和一些其他重要协议或技术)

MiniAPI of .NET6 (14): Cross-domain CORS (Part 1)

Cisco ike2 IPSec配置

Data_web(九)mongodb增量同步到mongodb

"Digital Economy Panorama White Paper" Financial Digital User Chapter released!
随机推荐
Research status of target detection at home and abroad
log4j-slf4j-impl cannot be present with log4j-to-slf4j
The development status of cloud computing at home and abroad
2022-08-02 mysql/stonedb慢SQL-Q18-内存使用暴涨分析
[N1CTF 2018]eating_cms
CAS:153162-70-0_N-BOC-6-Biotinamidohexylamine
关于Yii2批量更新的操作
Data_web(八)mysql增量同步到mongodb
2022-08-02 mysql/stonedb slow SQL-Q18 - memory usage surge analysis
HCIP第十六天
七夕快乐!
What is Adobe?
Golang Chapter 1: Getting Started
pikachu Over permission
九种方式,教你读取 resources 目录下的文件路径
override学习(父类和子类)
Bytebase database schema change management tool
First domestic open source framework 】 【 general cloud computing framework, any program can be made into cloud computing.
Lift, Splat, Shoot: Encoding Images from Arbitrary Camera Rigs by Implicitly Unprojecting to 3D 论文笔记
MiniAPI of .NET6 (14): Cross-domain CORS (Part 1)