Categories

A Guide to connecting Microsoft PowerApps to CoreView Workflows


TABLE OF CONTENTS


Introduction & Prerequisites

This KB Guide is intended to provide an example of how Microsoft PowerApps can be connected to the CoreView API to execute CoreView Workflows.

    Prerequisites:

• PowerAutomate License which includes Premium Connectors


Phase 1 – Generate API Key

  • From within CoreView, click on your initials in the top-right corner > Manage API Keys
  • Manage (drop-down menu) > Add New App
  • Click the blue checkbox in the top-right corner.
  • Click the copy button on the Success screen that pops up to copy the API key, and paste it in a safe
  • place for later use.

 

Phase 2 – Gather Information from Workflow in CoreView

  • Navigate to your Workflow for your PowerApps use case.
  • In the top-right, click on Actions > Edit > Configure Execution Inputs
  • Copy the name of each input into a notepad for use later.
    NOTE: If any inputs are the “List” type, you will want to mimic those list options within the PowerApp.

Phase 3 - Microsoft PowerAutomate

NOTE: This step requires a PowerAutomate Premium license. If you do not have this already, you will need to procure the appropriate licensing to allow for Premium Connectors.

  • From PowerAutomate > click Create > Instant cloud flow
  • Set the appropriate Flow name; we advise making this unique to the CoreView Workflow that you will be triggering.
  • Choose PowerApps (V2) for the trigger > click Create
  • Click on the PowerApps (V2) step. From here you will build all of the inputs that come over from PowerApps, and eventually communicate over to the CoreView Workflow. While you can use any of these inputs, the most common use cases will utilize the Text input.

    Select the Text input for this example:

  • In the Input field, remove the word “Input” and copy/paste in the first input title that you are bringing over from Phase 3.
    NOTE: The order of the inputs must be the same as the submit button command within your PowerApp or the field data will communicate improperly to PowerAutomate and the CoreView Workflow.

  • Once you finish creating your inputs, click on the + symbol under the step to add another step. Search for and select the HTTP action:

    Method: GET

    URI: https://www.loginportal.online/api/auth 

    Headers:

    Acceptapplication/json
    AuthorizationBearer Insert_CoreView_API_Key


     NOTE: Be sure to include a space after the word, Bearer.

  • Click the + symbol below the HTTP step > search for and select the Parse JSON action:

  • Click in the Content field > insert the dynamic input: Body

  • Copy and paste the following code starting with { and ending with } into the Schema box:

    {
    "type": "object", 
    "properties": {
    "userId": { 
    "type": "string"
    }, 
    "sessionId": {
    "type": "string" },
    "userName": { 
    "type": "string"
    }, 
    "displayName": {
    "type": "string" 
    },
    "bearerToken": { 
    "type": "string"
    }, 
    "refreshToken": {
    "type": "string" 
    },
    "profileUrl": {
    "type": "string"
    }, 
    "roles": {
    "type": "array", 
    "items": {
    "type": "string" 
    }
    }, "permissions": {
    "type": "array" },
    "responseStatus": { 
    "type": "object", 
    "properties": {}
        } 
      }
    }

  • Click the + symbol and add another HTTP step:


    Method: POST

    URI: https://<DATACENTER>.coreview.com/api/executions/INSERT_WORKFLOW_ID_HERE

    > DATACENTER Prefixes for above URL: > United States: wfusapi

        > United States Gov: wfus2api

        > Canada: wfcaapi

         > EMEA: wfeuapi
    > Workflow ID: Navigate to your CoreView Workflow > Id: > copy the Id and paste into the URL.      

    Headers:

    Accept
    application/json
    Authorization
    Bearer DYNAMIC_BEARER_TOKEN_INPUT
    x-scompany
    Ask CoreView support for your company ID 
                                



    > For the Authorization header, insert the Bearer dynamic input, per the screenshot below.

    > For the x-scompany header, open a ticket with CoreView Support inquiring for your Company ID for use within API connectors, and they will send you the unique Company ID for your tenant.

  • In the body field, use the following template format to build your JSON input for the CoreView Workflow:

    {
    “CoreView_Workflow_Input_1”: <Insert_Dynamic_Input_1>, “CoreView_Workflow_Input_2”: <Insert_Dynamic_Input_2>, “CoreView_Workflow_Input_3”: <Insert_Dynamic_Input_3>, 
    }

    NOTE: The final line has no comma at the end.


  • Click the + symbol; search for and add the Respond to a PowerApp or flow, and type True into both fields:

  • From within your PowerApp > click on PowerAutomate in the side command bar > Add flow > select your newly created flow.

  • Select the button that you are using for submitting to PowerAutomate.

  • Use the following code template to build your submission:


    NAME_OF_YOUR_POWERAUTOMATE_WORKFLOW.run(INPUT_1.Text, INPUT_2.Text, INPUT_3.Text);
    
    Reset(INPUT_1);Reset(INPUT_2);Reset(INPUT_3);


    Phase 4 - Testing

  • Click the play icon in the top-right of PowerApps
  • Fill out your inputs and click your submission button.
  • Go to your Workflow and confirm that it is running / has ran. If it did not, then you will need to review the steps above to ensure that you did not overlook anything.


    PLEASE NOTE THAT COREVIEW SUPPORT IS UNABLE TO SUPPORT THIS PROCESS IN ANY WAY. IF YOU CANNOT DETERMINE THE ISSUE ON YOUR OWN, PLEASE CONSULT WITH YOUR COREVIEW Customer Success Manager (CSM) TO DETERMINE TROUBLESHOOTING OPTIONS, IF ANY.