让客户在 AppSource 上体验你的应用Let customers test drive your apps on AppSource

是否热衷于在 PowerApps 中生成应用?Are you passionate about building apps in PowerApps? 是否有应用要与客户共享?Do you have an app you would like to share with customers? AppSource.com 现在支持 PowerApps 体验版解决方案,以便你可以与客户共享应用,为你的企业带来新的潜在客户。We now support PowerApps Test Drive solutions on AppSource.com as a way for you to share apps with customers, and generate leads for your business.

什么是体验版解决方案?What is a Test Drive solution?

借助体验版解决方案,客户无需注册 PowerApps 计划或安装任何应用,即可试用实际应用。A Test Drive solution enables your customers to try out a real app, without signing up for a PowerApps plan or installing any applications. 客户只需使用 Azure Active Directory (AAD) 帐户登录 AppSource.com,即可在 Web 浏览器中运行应用。Customers just sign into AppSource.com using their Azure Active Directory (AAD) account and run the app in a web browser. 如果没有体验版解决方案,客户就只能阅读应用相关信息或观看应用介绍视频。Without Test Drive, customers can only read about your app or watch a video that describes it. 借助体验版解决方案,客户可以更好地了解你的解决方案以及你的应用有哪些功能。With Test Drive, customers get a better idea of what your solution is and what functionality your app has. 同时,还能获得应用的实际使用体验。And they have the experience of actually using the app. 客户无法了解应用的内在工作原理,因此你的知识产权是受到保护的。Customers won't be able to look under the hood to see how your app is built, so your intellectual property is protected. 我们会收集并共享启动体验版应用的用户的潜在客户信息,从而帮助你拓展业务。We collect and share lead information for users that launch your Test Drive app to help you grow your business.

下面的示例展示了 AppSource.com 上的应用列表Here is the example of an app listing on AppSource.com:

<span data-ttu-id="b816f-116">示例 AppSource 列表</span><span class="sxs-lookup"><span data-stu-id="b816f-116">Sample AppSource listing</span></span>

选择上面应用列表中的“免费试用”链接,用户可以直接在浏览器中启动相关的 PowerApps 体验版应用:Selecting the Free Trial link from the app listing above launches the associated PowerApps Test Drive app directly within the user's browser:

示例应用 Web 播放器

如何生成体验版解决方案?How do I build a Test Drive solution?

生成用于体验版解决方案的应用与在 PowerApps 中生成其他任何应用类似,不同之处在于使用的是嵌入数据,而不是外部数据连接。Building an app for a Test Drive solution is just like building any app in PowerApps, but you use embedded data instead of external data connections. 使用嵌入数据,可以减少将应用部署给客户时遇到的障碍,这样客户就能十分顺畅地试用应用。最终分发给客户的完整解决方案通常包括数据连接,而嵌入数据则非常适用于体验版解决方案。Using embedded data reduces the barrier of deploying the app to your customer, so there is zero friction for them to try it out. The full solution that you ultimately distribute to customers typically includes data connections, but embedded data works well for a Test Drive solution.

PowerApps 为生成包含嵌入数据的应用提供本机支持,因此只需提供应用要使用的示例数据即可。PowerApps natively supports building apps with embedded data, so you just need sample data for your app to use. 应在 Excel 文件中以一个或多个表的形式捕获此类数据。This data should be captured in an Excel file as one or more tables. 然后,在 PowerApps 中,将 Excel 表中的数据拉取到应用中,并在应用中直接使用此类数据,而不用借助外部连接。In PowerApps, you then pull the data from the Excel tables into the app and work with it there, rather than through an external connection. 下面的三步流程展示了如何拉取数据并在应用中使用此类数据。The three-step process below shows you how to pull data in and use that data in your app.

第 1 步:将数据导入应用Step 1: Import data into the app

假定你有一个 Excel 文件,其中包含“SiteInspector”和“SitePhotos”这两个表。Assume you have an Excel file with two tables: SiteInspector and SitePhotos.

要导入的 Excel 表

使用“将静态数据添加到应用”选项,将这两个表导入 PowerApps。Import these two tables into PowerApps by using the option Add static data to your app.

将静态数据添加到应用

此时,这两个表已成为应用中的数据源。You now have the tables as data sources in your app.

作为已导入的数据源的 Excel 表

第 2 步:处理只读和读写情境Step 2: Handling read-only and read-write scenarios

由于导入的是静态数据,因此数据为只读。The data you imported is static, therefore read-only. 如果应用是只读的(即只向用户显示数据),请直接在应用中引用这两个表。If your app is read-only (i.e. it only displays data to the user), reference the tables directly in the app. 例如,如果要访问“SiteInspector”中“Title”字段,请在公式中使用“SiteInspector.Title”。For example, if you want to access the Title field in the SiteInspector table, use SiteInspector.Title in your formula.

如果应用可读写,请先将每个表中的数据拉取到集合(即 PowerApps 中的表格数据结构)中。If your app is read-write, first pull the data from each table into a collection, which is a tabular data structure in PowerApps. 然后,使用集合,而不是表。Then work with the collection rather than the table. 若要将“SiteInspector”和“SitePhotos”表中的数据拉取到“SiteInspectorCollect”和“SitePhotosCollect”集合中,请编写以下公式:To pull data from the SiteInspector and SitePhotos tables into the SiteInspectorCollect and SitePhotosCollect collections:

ClearCollect(SiteInspectorCollect,SiteInspector); ClearCollect(SitePhotosCollect,SitePhotos)

此公式会清除这两个集合,然后将各个表中的数据收集到相应的集合中:The formula clears both collections, then collects data from each table into the appropriate collection:

  • 在应用中的某处调用此公式,从而加载数据。Call this formula somewhere in your app to load the data.
  • 依次转到“文件” > “集合”,即可查看应用中的所有集合。View all collections in your app by navigating to File > Collections.
  • 有关详细信息,请参阅创建和更新应用中的集合For more information, see Create and update a collection in your app.

现在,如果要访问“Title”字段,请在公式中使用“SiteInspectorCollect.Title”。Now if you want to access the Title field, use SiteInspectorCollect.Title in your formula.

第 3 步:在应用中添加、更新和删除数据Step 3: Add, update, and delete data in your app

至此,你已了解如何直接和通过集合读取数据;现在,我们将介绍如何在集合中添加、更新和删除数据:You've seen how to read data directly and from a collection; now we'll show you how to add, update, and delete data in a collection:

若要在集合中添加行,请使用 Collect( DataSource, Item, ... )To add a row to a collection, use Collect( DataSource, Item, ... ):

Collect(SiteInspectorCollect,{ID:Value(Max(SiteInspectorCollect, ID)+1),
    Title:TitleText.Text,SubTitle:SubTitleText.Text,Description:DescriptionText.Text)

若要更新集合中的行,请使用 UpdateIf( DataSource, Condition1, ChangeRecord1 [, Condition2, ChangeRecord2, ...] )To update a row in a collection, use UpdateIf( DataSource, Condition1, ChangeRecord1 [, Condition2, ChangeRecord2, ...] ):

UpdateIf(SiteInspectorCollect,ID=record.ID,
    {Title:TitleEditText.Text,SubTitle:SubTitleEditText.Text,Description:DescriptionEditText.Text)

若要从集合中删除行,请使用 RemoveIf( DataSource, Condition [, ...] )To delete a row from a collection, use RemoveIf( DataSource, Condition [, ...] ):

RemoveIf(SiteInspectorCollect,ID=record.ID)

备注

只有在应用运行时,集合才会保留数据;如果应用关闭,所有更改都会遭放弃。Collections hold data only while the app is running; any changes are discarded when the app is closed.

总之,可以创建包含嵌入数据的应用版本,从而模拟连接外部数据的应用体验。In summary, you can create a version of your app with embedded data, which simulates the experience of your app connecting to external data. 嵌入数据后,可以在 AppSource.com 上将此应用发布为体验版解决方案。After the data is embedded, you will be ready to publish this app as a Test Drive solution on AppSource.com.

如何在 AppSource.com 上列出我的体验版解决方案?How do I list my Test Drive solution on AppSource.com?

至此,你的应用已准备就绪,是时候将其发布到 AppSource.com 中了。在此流程中,请先在 PowerApps.com 上填写申请表单Now that your app is ready, it's time to publish it to AppSource.com. In order to start this process, please complete the application form on PowerApps.com.

申请后,你会收到一封电子邮件,其中介绍了如何提交要在 AppSource.com 上发布的应用。还可以单击此处,下载收录完整端到端流程的新手入门文档。Once you apply you will receive an email with instructions on how to submit your app to be published on AppSource.com. The onboarding documentation that captures the full end-to-end process can also be downloaded here.