讓客戶在 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,然後在網頁瀏覽器中執行應用程式。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="f6871-116">範例 AppSource 清單</span><span class="sxs-lookup"><span data-stu-id="f6871-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 檔案有兩個資料表︰SiteInspectorSitePhotosAssume 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.TitleFor 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. 若要從 SiteInspectorSitePhotos 資料表提取資料至 SiteInspectorCollectSitePhotosCollect 集合: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.TitleNow 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)

附註︰集合只會在應用程式執行時保留資料,應用程式關閉後,任何變更都會被捨棄。Note : 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。若要開始此程序,請填寫 flow.microsoft.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.