We’re heading into the third week staying home, and with some weeks more ahead of us we need some entertainment.

Last week Eva asked me if we could create an app using the Power Platform to play mime games remotely. She’d design it graphically and functionally and I’d (no) code it. And that’s what we did!

1 2 3 Power Mime!
1 2 3 Power Mime!

How does the app work?

The solution is very simple and consists of an entity, where we store the actions to represent, and the Power App. And the best of all is that you can customize the game!

1 2 3 Power Mime!
1 2 3 Power Mime!

Using the data from the entity, the app only needs to randomly get one of the records and display its text using this formula:

Set(
    VAR_Id,
    Text(
        Rand() * 100,
        "[$-en-US]000#"
    )
);
Set(
    VAR_Desc,
    LookUp(
        PMECards,
        Id = VAR_Id
    ).Description
);
UpdateContext({VAR_Img1: !VAR_Img1})

The first Set gets a random record of the entity using the Rand() function. The second Set will update the text of the white box where the action is displayed to the player.

Customize it!

As I said, you can just populate the entity with whatever you want to play to: actions, famous people, movies, etc. You just need to do the following:

  • Make sure the autonumber Id field is a 4-digit number, without any prefix or sufix:
Autonumber field setup
Autonumber field setup
  • Add all the records to the entity (using the Excel add-in for example):
Fill in the data using the Excel add-in
Fill in the data using the Excel add-in
  • In the Excel file you only need to fill the description field, the Id field will be automatically generated when publishing the changes.
  • Change the button formula in the app to reflect the number of options you’ve created in the previous step:
Set(
    VAR_Id,
    Text(
        Rand() * YOUR_NUMBER_OF_LINES_HERE,
        "[$-en-US]000#"
    )
);
  • Change the YOUR_NUMBER_OF_LINES_HERE for the number of lines you’ve created using the Excel add-in.

And it’s done! Thanks to Eva for having the idea and the design she has done (and for many of the actions we’re using in our version :P). You can also read the post Invent counting with AI Builder and see what a wonderful app she designed for me.

You can download the unmanaged solution which includes the entity and Power App and import it into your environment and start playing!

Subscribe!

Receive an email when a new post is published
Author

Microsoft Dynamics 365 Finance & Operations technical architect and developer. Business Applications MVP since 2020.

Write A Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

ariste.info