Use Peltarion connector in Microsoft Power Apps

Create an app to call your deployed classification model

When you’ve built, trained, and deployed your model on the Peltarion platform, you want to put it to use. This tutorial will show you how to use the Peltarion connector in Microsoft Power Apps.

Note: This tutorial needs to call a deployed model. We recommend you to do the Classify customer complaints tutorial first.

12 - No prior Power App or coding knowledge required.
12 - 20 minutes to build and set live.

You will learn to

12 - Build an app with Microsoft Power Apps
12 - Connect Microsoft Power Apps and Peltarion platform

Rather watch?
See how Björn did this.

Power Apps GUI
Figure 1. Power Apps user interface

Create your Power App

Note
Set Language to English. Translation formatting do funny things with your code otherwise.
  1. Log into Power Apps (or create an account if you don’t have one yet)

  2. Create a new Power App:
    Go to Apps → click on New App → click on Canvas → then choose to create an empty Phone layout.

  3. Add the following three components to the canvas:

    • Text input. This is where you write your test complaint. You can remove the default text and add a Hint text, e.g. Write message here.

    • Button. Used to call the Peltarion model. Rename it What’s the complaint about?

    • Text label. This is where the result will be displayed.

200


Add the Peltarion connector

Let’s connect the app with your deployed Peltarion model.

  1. Open the Data view in Power Apps. In the search box that appears, write Peltarion and select the Peltarion connector.
    PowerAppsData search PA1

  2. Enter your model’s API URL and API token.
    You can find these in the Deployment view of the experiment you want to deploy.
    200

  3. Click Connect. Now, the connection is done!


Call the deployed Peltarion model

Now, you want to call your API to run inference on your newly trained model. Let’s add an action to the Button component and display the result in the Label component!

  1. Click the Button component. Name it What’s this about?

  2. In the Formula field (Fx) 25 at the top add the following code (Type the name of your input parameter instead of <YOUR-INPUT-PARAM>):

ClearCollect(dd, {<YOUR-INPUT-PARAM>: TextInput1.Text});
Set(jdata, JSON(dd, JSONFormat.IncludeBinaryData));
Set(res, Peltarion.callapi(jdata))
  1. Click the Text label component.

  2. Add the following code to the Formula field (Fx):

res.key

Check out our plugin GitHub page for more details.

Note: At this stage it’s a good idea to save the Power App.


Run the app and get a prediction

  1. Start the Power App by clicking the Play button 25 in the top right corner.

  2. Enter a complaint in the text input, e.g., I like my credit card bill, but why does it come every month?

  3. Press the Button and wait for a response from the Peltarion platform.
    The first time you call your model this will take a little bit longer (around 20 seconds).

You should now have a fully working app to classify your customer complaints for you!

Troubleshooting

In case nothing happens once the model has finished loading:

  1. Go back to the editing page of your app.

  2. Select the Text box, add the formula:
    res.errorMessage and hit Enter.
    You will then get information about why an error occurred.


What you’ve learned

With this tutorial, we’ve learned to integrate Power Apps and the Peltarion platform. Well done!

Was this page helpful?
YesNo