Automate alerts with Power Automate
From SpinetiX Support Wiki
Contents
Introduction
This tutorial focuses on automating alerts within ARYA by leveraging Power Automate to create an automation API. Power Automate, formerly known as Microsoft Flow, is a cloud-based service and workflow automation tool provided by Microsoft as part of the Microsoft Power Platform. It enables users to create automated workflows and tasks across various Microsoft and third-party applications.
Automating alerts within ARYA streamlines the process of managing alerts by automatically activating and deactivating them based on predefined conditions. This integration ensures timely notifications and reduces the need for manual intervention, thus enhancing the efficiency of monitoring and response systems.
Tutorial
This walkthrough outlines the process of automating alerts within ARYA using Power Automate. Automating ARYA alerts using Power Automate involves creating flows and setting various types of input triggers. Input types for manual triggers can include text, number, yes/no, file, email, date, and many more. In this tutorial, we will be creating a simple flow using a button (yes/no) as the trigger. This guide offers a comprehensive step-by-step approach to setting up alert automation utilizing Microsoft Power Automate, specifically by employing the Automation API to activate and deactivate alerts.
Requirements
- ARYA account
- ARYA Alert ID
- ARYA API key
- ARYA account ID
- A Microsoft 365 Account
Get the necessary information
To set up the automation in Power Automate, you'll create a flow with a webhook request. You'll need the following URL and the specific values highlighted in red:
https://arya.services.spinetix.com/v1/alerts/ALERTID/state?apiKey=APIKEY&accountId=ACCOUNT
The values you need are ALERTID, APIKEY, and ACCOUNT ID. Please follow the instructions below to retrieve them.
Set up an Alert
The first thing to do is set up the alert that you want to use. For this tutorial, we will use the Fire Alert. However, feel free to select a different alert or create a new one if you prefer.
- Go to https://arya.spinetix.cloud/.
- Log in to your account.
- Navigate to the main menu on the left and go to ALERTS.
- Select the Fire Alert.
Choose the players on which the alert will show
The next step is to choose the players to which you want to send the alert and have it show.
This is done by selecting the target player(s), activating and then deactivating the alert. For this tutorial we will send the alert on all players, but the alert can instead be sent to groups of players, or only specific ones.
- On the right, click on the plus (+) sign and select ALL PLAYERS.
- Click ACTIVATE. This will save the list of selected players, send and activate the alert on all your player(s); you should now see the alert displayed on your screen(s).
- Go back to the ALERTS page.
- Select the alert and on the right, click on DEACTIVATE to stop showing the alert; we will activate it again via Power Automate later.
Get the Alert ID
- After completing the activation and deactivation process, select and open the desired alert by clicking on the edit icon.
- In your browser's address bar, locate and copy the alert's ID.
Get your ARYA API Key
- On the top left, Go to Settings > API
- Click on Generate new API key on the right.
Get your ARYA account ID
- On the top left, Go to Settings > Account Info
- Copy the value under ACCOUNT ID
Prepare the URL
With the values that you have obtained, use a text editor (Notes, Sticky Notes, Word) and prepare the URL by inserting the values that you have obtained, for instance:
https://arya.services.spinetix.com/v1/alerts/5xOwWYtmlKYWft0EAPkQTSv2G9ixzAbeO/state?apiKey=QjVSfYNUYoYiqJCkH8Gh&accountId=rpj9h4SJsJfvmAXF3A2W0Cxkrrs1BcjZRn
You will need this URL in a later step in the Power Automate guide below.
Power Automate
Now that you have all the necessary information for the setup, It's time to and create a simple flow in Power Automate. Follow these steps to create a simple Flow with a manual trigger in Microsoft Power Automate to activate or deactivate an Alert in ARYA.
- Go to your Microsoft 365 portal and log in if needed.
- Then, using the search bar, search for Power Automate and select it.
- Or, go to the App launcher on the top left, click on Explore all your Apps, Scroll down and select Power Automate.
- Click Create on the menu on the left column then select Instant cloud flow.
- Choose the first trigger on the list Manually trigger a flow and click Create.
- On the top left, click on Untitled and give your flow a name. In this case, We named the flow Activate ARYA Alert.
- Click on the trigger and click Add an input.
- For activating and deactivating an alert we need a boolean input, so we select Yes/No as the input type.
- You can edit the Trigger title and description if you like or leave it as it is. For this tutorial we have name the trigger title "Activate" and the description "Activate Alert".
- Add a new step to the flow, click on the plus + button and then on Add an Action .
- On the search box, type HTTP and select HTTP.
- In the HTTP request fields. you will need to fill in the URI, Method and Body fields. The HTTP request is the command that we will be sending to ARYA (Activate/Deactivate an alert).
- URI: Use the URL that you have prepared in the previous section.
- Method: The method to use here is PUT as we are requesting to Activate or Deactivate an Alert in ARYA.
- Body: Type
{ "enabled": }
, then hover your mouse to the right of the text field, after the:
, select the lightning bolt, and choose the trigger value. This will enable the alert when the "Activate" toggle is enabled in the trigger and deactivate when not. For more details, refer to the API documentation on how to structure the request body. - Once you are done, click on Save.
Testing the automation
Now that you have set up a Flow in Power Automate, it is time to put it to the test. For the convenience of users, this tutorial demonstrates the testing process using the Power Automate mobile app. This approach allows for easy execution of the automation anytime, anywhere, directly from a mobile device.
- Download and Install the Power Automate mobile app.
- Login with your Microsoft 365 Account.
- Once logged in, you will see the list of flows created in your account.
- To run a flow, click on the three dots on the right of the flow → Run flow.
- Or alternatively, click on the flow and click the PLAY button on the top right.
- Next, toggle on Activate to activate the alert and click on Run flow.
- After running the flow, you will be back on the home screen and a message stating "Flow ran successfully" will appear briefly.
- Check your screens, the Fire Alert should now be showing on all players.
- You can also go to your ARYA account, schedule page, select on of the target player(s) and verify if the alert is showing by looking at the snapshot.
- Next, to deactivate the alert. Toggle off Activate in the Power Automate app and click on Run flow.
- The Fire Alert should now stop showing on all players.
- You can also go to your ARYA account, schedule page, select on of the target player(s) and verify if the alert is no longer showing by looking at the snapshot.
Congratulations! You've effectively established an automation to trigger alerts in ARYA using Power Automate.
Conclusion
This tutorial has demonstrated the integration between ARYA and Power Automate for automating alerts. By following the outlined steps, users can efficiently set up and manage alerts with minimal manual intervention.
Automating ARYA alerts with Power Automate can be extended to various scenarios, such as automatically triggering alerts based on email conditions, scheduled calendar events, or even specific data inputs from other connected applications. Your imagination is the limit!