Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Expand
titleHow to switch to classic D365 viewer

Click SolutionsAPSD...Switch to classic

...

Expand
titleHow to create custom connectors [DEV ONLY]
Note

Only for the DEV environment

Custom connectors must be created before importing the APSD & Flows solutions.

  1. Clone the APSD-PAPS repository to your local computer.

  2. On the left hand menu, navigate to DataCustom Connectors.

  3. Click on + New custom connectorImport an OpenAPI file.

  4. In the Connector name field, type “NAPA-SNAPA”.

  5. Click Import and go to \repos\APSD-PAPS\Custom Connectors\JSON and Go into the APSD-PAPS Custom Connector solution. **Must be done from within the solution to ensure that the correct name is generated (ap_5Fnapa-2Dsnapa).**

  6. Select + NewAutomationCustom connector.

    Image Added
  7. Enter in the info as follows:

    • Connector Name: NAPA-SNAPA

    • Host: www

  8. Click Create connector.

  9. Return to the APSD-PAPS Custom Connector solution and verify the name of the connector is correctly formatted.

  10. On the left hand menu, navigate to Custom connectors.

  11. Click on + New custom connectorImport an OpenAPI file.

  12. Click Import and go to \repos\APSD-PAPS\Custom Connectors\JSON and select the NAPA-SNAPA.json file.

  13. Click Continue.

  14. Verify that the Host and Base URL point are using the environment variables (to ensure it is pointing to the correct location for the environment you are in (- refer to chart belowin API Connections ).

  15. For NAPA API only: Set up OAuth security

  16. Click Create connector.

  17. Click on the Test tab, then + New connection.

  18. Enter the API Key (RDIMS 17999814) and click Create connection.

  19. Repeat steps 3-10 to create the rest of the connectors using their json files (SIAPI, SPAPI, MTAPI & TMAPI). *Note: SIAPI doesn’t require an API Key.

  20. On the left hand menu, navigate to DataConnections.

  21. For each connection, share them with the organization.

    • Click ...Share+ Add everyone in my orgSave.

    • This must be done so that any changes to the API Key get shared to all users. The update should be instant, if users are not receiving the updated key, they will need to clear their browser’s cache.

    • Give edit access to TC-CivAv Azure group.

Info

Below are the steps to install APSD-PAPS in D365 PowerApps platform.

Setting up a new environment may take up to an hour.

Setting Up a New Environment

When setting up a brand new environment, there are a few additional steps that must be done other than simply importing the solution. The NAPA-SNAPA custom connector must be created (as there is currently a bug that doesn’t allow it to be migrated with the solution due to the OAuth secrets) and all lookup data must be imported.

Expand
titleAdd CivAv application from Azure Portal as an Application User

This must be done in order for the pipeline & for the flows to work (we are using Service Principal account to connect to Dataverse).

  1. Go to the Power Platform admin center.

  2. Select the new environment.

  3. In the Access section, click on See All under S2S Apps.

    Image Removed
  4. Click + New app user.

  5. Click + Add an app and enter in the App ID in the search bar.
    CivAv-APSD-PAPS: 27b29278-594f-484d-a0c0-9c61381bad31

    Image Removed
  6. For the business unit, select the one with the environment name.

  7. Edit the security roles and select System Administrator and System Customizer.

  8. Click Create.

...

Expand
titleCreating connections for Do Not Reply APSD / Ne Pas Répondre PAPS
Note

Perform the steps in this section in a FireFox browser. For some reason, Chrome auto-signs in to your personal account.

  1. Go to https://myaccount.microsoft.com/, click on your profile icon in the top right corner and select Sign in with a different account.

    Image Removed
  2. Click + Use another account.

  3. Log in to DoNotReplyAPSD-NePasRepondrePAPS@tc.gc.ca (info in RDIMS 17999814).

  4. In the same browser, go to Power Apps Studio.

  5. Click on Data/Dataverse > Connections in the side menu.

  6. Click on + New connection and select Office 365 Outlook.

  7. Click Create and select the Do Not Reply APSD account that you signed into in Step 3.

  8. Repeat Steps 6-7 for the Office 365 Groups and Excel Online (Business) connections.

You should now have the following connections set up

Image Removed
Expand
titleCreating Service Principal connections
  • Open the Power Apps Studio and click on Flows in the side menu.

  • Click + New flow > Instant cloud flow.

  • Select Manually trigger a flow, then Create.

  • Click + New step > Microsoft Dataverse > select any action.

  • Click on the … and +Add new connection.

  • Click Connect with service principal.

  • Image Removed

    The connection name should be “CivAv APSD Service Principal”. The rest of the info is in RDIMS 17999814.

  • Click Create

    To update an existing connector using the JSON definition

    • On the left-hand menu, click on Custom connectors.

    • Beside the NAPA-SNAPA connector, click ... > Update from OpenAPI file.

      Image Added
    • Click Import and go to \repos\APSD-PAPS\Custom Connectors\JSON and select the NAPA-SNAPA.json file.

    • Click Continue.

    • Toggle the Swagger Editor ON > OFF.

    • Go to the Security tab and enter in the information as per RDIMS 17999814.

    • Click Update connector.

    • Click X Close.

    Info

    Below are the steps to install APSD-PAPS in D365 PowerApps platform.

    Setting up a new environment may take up to an hour.

    Setting Up a New Environment

    When setting up a brand new environment, there are a few additional steps that must be done other than simply importing the solution. The NAPA-SNAPA custom connector must be created (as there is currently a bug that doesn’t allow it to be migrated with the solution due to the OAuth secrets) and all lookup data must be imported.

    Expand
    titleAdd CivAv application from Azure Portal as an Application User

    This must be done in order for the pipeline & for the flows to work (we are using Service Principal account to connect to Dataverse).

    1. Go to the Power Platform admin center.

    2. Select the new environment.

    3. In the Access section, click on See All under S2S Apps.

      Image Added
    4. Click + New app user.

    5. Click + Add an app and enter in the App ID in the search bar.
      CivAv-APSD-PAPS: 27b29278-594f-484d-a0c0-9c61381bad31

      Image Added
    6. For the business unit, select the one with the environment name.

    7. Edit the security roles and select System Administrator and System Customizer.

    8. Click Create.

    Anchor
    GenericAccountSignIn
    GenericAccountSignIn

    Expand
    titleCreating connections for Do Not Reply APSD / Ne Pas Répondre PAPS
    Note

    Perform the steps in this section in an Edge/FireFox browser. For some reason, Chrome auto-signs in to your personal account.

    1. Go to https://myaccount.microsoft.com/, click on your profile icon in the top right corner and select Sign in with a different account.

      Image Added
    2. Click + Use another account.

    3. Log in to DoNotReplyAPSD-NePasRepondrePAPS@tc.gc.ca (info in RDIMS 17999814).

    4. In the same browser, go to Power Apps Studio.

    5. Click on Connections in the side menu (don’t save the flow). You can now see the new connection.

      Image Removed

      Delete any other connections that were created.

    6. Click on + New connection and select Office 365 Outlook.

    7. Click Create and select the Do Not Reply APSD account that you signed into in Step 3.

    8. Repeat Steps 6-7 for the Microsoft Dataverse Office 365 Groups and Excel Online (Business) connections.

    You should now have the following connections set up

    Image Added
    Expand
    titleExport the solution from DEV
    Info

    The APSD Canvas app is inside the APSD-PAPS Flows solution.

  • Open the Power Apps Studio and select the ap-dev-tcd365 environment.

  • Select the solution you need to migrate.

  • Click ExportPublishNext.

  • Increase the version number as needed (revision # is automatically increased).

  • Select corresponding export as type, then click on Export.

    • Managed: APSD, APSD-PAPS Admin, DataVerse-Security Role

    • Unmanaged: APSD-PAPS Flows, APSD-PAPS Custom Connectors, APSD-PAPS Env Variables

  • Download the exported file.

  • Repeat steps 2-6 for any other solutions required
    Creating Service Principal connections
    1. Open the Power Apps Studio and click on Flows in the side menu.

    2. Click + New flow > Instant cloud flow.

    3. Select Manually trigger a flow, then Create.

    4. Click + New step > Microsoft Dataverse > select any action.

    5. Click on the … and +Add new connection.

    6. Click Connect with service principal.

    7. Image Added

      The connection name should be “CivAv APSD Service Principal”. The rest of the info is in RDIMS 17999814.

    8. Click Create.

    9. Click on Connections in the side menu (don’t save the flow). You can now see the new connection.

      Image Added
    10. Delete any other connections that were created.

    Expand
    titleImport Export the solution from DEV
    Note

    Solution Import Order Must be followed or will break dependencies
    APSD-PAPS Env Variables > APSD-PAPS Custom Connectors > APSD > APSD-PAPS Flows > APSD-PAPS Admin

    Ideally, all imports would be with the APSD Generic Account. For PROD, this must be followed.

    Steps to login and use this account are in here: Creating connections for Do Not Reply APSD / Ne Pas Répondre PAPS

    Info

    Basic steps to import a solution:

    1. Click on Solutions on the left-hand menu and then Import in the top menu bar.

    2. Select Browse and point to the zip file, e.g. APSD_PAPS_EnvVariables_1_0_0_X.zip, created in the export solution steps.

  • Go to the desired environment.

  • Once the Env Variables solution has been imported

    • Edit the variables to ensure they have the correct values for the environment

  • Once the Custom Connectors solution has been imported

  • Clone the APSD-PAPS repository to your local computer.

  • Go into the APSD-PAPS Custom Connector solution. **Must be done from within the solution to ensure that the same name is generated (ap_5Fnapa-2Dsnapa).**

  • Click on + New > Automation > Custom connector

    Image Removed
  • Enter in the info as follows:

    • Connector Name: NAPA-SNAPA

    • Host: www

  • Click Create connector.

  • Return to the APSD-PAPS Custom Connector solution and verify the name of the connector is ap_5Fnapa-2Dsnapa.

  • On the left-hand menu, click on Data/Dataverse > Custom connectors.

  • Beside the NAPA-SNAPA connector, click ... > Update from OpenAPI file.

    Image Removed
  • Click Import and go to \repos\APSD-PAPS\Custom Connectors\JSON and select the NAPA-SNAPA.json file.

    • Use the NAPA-SNAPA [PROD].json for Production environment

  • Click Continue.

  • Toggle the Swagger Editor ON > OFF.

  • Go
    Info

    The APSD Canvas app is inside the APSD-PAPS Flows solution.

    1. Open the Power Apps Studio and select the ap-dev-tcd365 environment.

    2. Select the solution you need to migrate.

    3. Click ExportPublishNext.

    4. Increase the version number as needed (revision # is automatically increased).

    5. Ensure they are all exported as Managed, then click on Export.

      • Managed: APSD, APSD-PAPS Admin, DataVerse-Security Role

      • Unmanaged: APSD-PAPS Flows, APSD-PAPS Custom Connectors, APSD-PAPS Env Variables

    6. Download the exported file.

    7. Repeat steps 2-6 for any other solutions required.

    If any of the flows are off:

    If ‘Modify Users’ flow is off, turn on ‘Remove User’ and ‘Update User’ flows first (if not already on).

    1. Select the flow and click Turn on.

    2. If there is an error, select the flow and click Edit.

    3. If you are brough to a screen asking to confirm the flow connections, ensure all are using the connection references inside the solution then click Continue.

      Image Removed
    4. Once you are brought to the flow screen, click Save.

    5. Steps 6 - 9 are only for certain flows (e.g. those with a manual trigger).

    6. Go back to the solution and click on the flow name to view its details.

    7. Click on Edit in the Run only users section.

      Image Removed
    8. Ensure that all the connections are using the generic account connections and NOT “Provided by run only user”.

      Image Removed
    9. Click Save.

    10. Click Turn on.

    11. Repeat steps 1-10 for any other flows that are not on.

    Expand
    titleImport the solution
    Note

    Solution Import Order Must be followed or will break dependencies
    1 APSD-PAPS Env Variables > 2 APSD-PAPS Custom Connectors > 2.1 APSD Connection References > 3 APSD > 4 APSD-PAPS Flows > 5 APSD Apps

    Ideally, all imports would be with the APSD Generic Account. For PROD, this must be followed.

    Steps to login and use this account are in here: Creating connections for Do Not Reply APSD / Ne Pas Répondre PAPS

    Info

    Basic steps to import a solution:

    1. Click on Solutions on the left-hand menu and then Import in the top menu bar.

    2. Select Browse and point to the zip file, e.g. APSD_PAPS_EnvVariables_1_0_0_X.zip, created in the export solution steps.

    1. Go to the desired environment.

    2. Once the Env Variables solution has been imported

      • Edit the variables to ensure they have the correct values for the environment. This must be done through the Default solution.

    3. Once the Custom Connectors solution has been imported

      • For the NAPA connector, go to the Security tab and enter in the information as per RDIMS 17999814.

      • Click Update connector.

      • Click
        • Depending on the

        Test tab, then + New connection.
      • Click X Close.

      • For the rest of the connectors,
        • settings, the NAPA connector may be pointing to prod rather than dev, so make sure to use correct client ID/secret when setting up the connector.  

      • Click Update connector.

      • Click on the Test tab, then + New connection.

      • Click X Close.

      • For the rest of the connectors, edit them and go to the Test tab, then click + New connection (API key keys are in RDIMS 17999814 or key vaults (Dev / Prod)).

      • On the left-hand menu, click on Data/Dataverse > Connections.

      • For the MTAPI, SIAPI, SPAPI & TMAPI connections, share them with the organization.

        • Click ...Share+ Add everyone in my orgSave.

          • This must be done so that any changes to the API Key get keys gets shared to with all users. The update should be instant, if users are not receiving the updated key, they will need to clear their browser’s cache.

        • Give edit access to TC-CivAv Azure group.

    4. Import the APSD Connection References solution

    5. When importing the Flows solution

      • Click Next twice then select the CivAv APSD Service Principal connection for Dataverse and the shared connections for the APIs.

      • For the Office 365 and Excel Online connections, select the Do Not Reply APSD / Ne Pas Répondre PAPS connection created earlier.

        Image Removed
    6. Click Import and wait for the process to finish.

    7. Click on Publish all customizations.

      • Outlook, Excel, & Office connection references should be set up using the DoNotReplyAPSD user account connections. 

      • For the Key Vault connection, the “Default Azure AD application for OAuth” can be used, and the keyvault name is “civav-dev-kv-apsd-paps” or “civav-prod-kv-apsd-paps”.

        Image Added
      • Once done, the connections should be as follows:

        Image Added
    8. Import the APSD and then the Flows solution

      • Verify that all the required flows are turned on.

      If any are off, follow the steps at the end of this section.Share
      • Some may be off initially due to parent-child flows.

      • Go to the “Calculate Billable Hours” flow & click Edit in the “Run only users” section. Ensure that the SIAPI connection is set to “Use this connection (SIAPI)”.

    9. Import the APSD apps solution

    10. Click on Publish all customizations.

    11. Share the APSD-PAPS Canvas App with Everyone in TC. Uncheck the box at the bottom “Send an email invitation to new users”.

    12. Share the Canvas apps with the other developers individually, checking off the co-owner box.

    13. PROD ONLY: Edit the APSD-PAPS Canvas App. Go into the App.OnStart() and edit the MTOA JWT token to the Production one.

    14. Assign a security role to yourself in order to test the application.

      Can be done through

      Assign a security role to yourself in order to test the application.

      • Can be done through Advanced Settings or the Admin center (see Granting security roles to users section).

    Anchor
    FlowsOffFlowsOff

    Migrating Changes Between Existing Environments

    Note

    Data will not be migrated between environments through the solution. You will need to perform data migration separately following the steps below.

    Expand
    titleExport the solution from DEV
    Info

    Most deployments will only require the APSD and Flows solutions to be migrated.

    • Custom Connectors solution must only be migrated if there are any changes to the existing custom connectors or a new custom connector is added.

    • Env Variables solution must only be migrated if new environment variables are added.

    Version number format: major.minor.build.revision number

    1. Open the Power Apps Studio and select the ap-dev-tcd365 environment.

    2. Select the solution you need to migrate.

    3. Click ExportPublishNext.

    4. Increase the version number as needed (revision # is automatically increased).

    5. Select corresponding export as type, then click on Export.

      • Managed: APSD, APSD-PAPS Admin, DataVerse-Security Role

      • Unmanaged: APSD-PAPS Flows, APSD-PAPS Custom Connectors, APSD-PAPS Env Variables

    6. Download the exported file.

    7. Repeat steps 2-6 for any other solutions required.

    Expand
    titleImport the solution
    Note

    Solution Import Order Must be followed or else will break dependencies
    APSD-PAPS Env Variables > APSD-PAPS Custom Connectors > APSD > APSD-PAPS Flows > APSD-PAPS Admin

    Only import the exported solutions from the previous section.

    Ideally, all imports would be with the APSD Generic Account. For PROD, this must be followed.

    Steps to login and use this account are in here: Creating connections for Do Not Reply APSD / Ne Pas Répondre PAPS

    1. Go to the desired environment.

    2. Click on Solutions on the left-hand menu and then Import in the top menu bar.

    3. Select Browse and point to the zip file, e.g. APSD_PAPS_EnvVariables_1_0_0_X.zip, created in the export solution steps.

    4. Click Import and wait for the process to finish.

    5. Import the rest of the solutions as needed.

    6. Click on Publish all customizations.

    7. Verify that all the required flows are turned on (flows are inside Flows and Admin solutions).

    If any of the flows are off:

    1. Select the flow and click Turn on.

    2. If there is an error, select the flow and click Edit.

    3. If you are brough to a screen asking to confirm the flow connections, ensure all are using the connection references inside the solution then click Continue.

      Image Removed
    4. Once you are brought to the flow screen, click Save.

    5. Steps 6 - 9 are only for certain flows (e.g. those with a manual trigger).

    6. Go back to the solution and click on the flow name to view its details.

    7. Click on Edit in the Run only users section.

      Image Removed
    8. Ensure that all the connections are using the generic account connections and NOT “Provided by run only user”.

      Image Removed
    9. Click Save.

    10. Click Turn on.

    11. Repeat steps 1-10 for any other flows that are not on.

    Note

    If importing the APSD Custom Connectors solution:
    Even if there are no edits to make, you must still go in to edit it and click on Update Connector for it to connect properly.

    Importing/Migrating Data

    When setting up a new environment, all lookup data must be brought into the environment. This can be done either through creating a dataflow to migrate data between environments or by importing the data from an Excel spreadsheet.

    Expand
    titleImporting task data - Export to Excel then import [NOT RECOMMENDED]
    Warning

    NOT RECOMMENDED METHOD

    Info

    Alternative solution: Follow https://docs.microsoft.com/en-us/powerapps/developer/data-platform/dataverse-odata-dataflows-migration to create a dataflow to migrate the data between environments. This currently exists for QA → ACC.

    1. Go to the environment that has the master set of data for the SCRAM tasks. Currently, this is QA.

    2. On the left menu, go to DataTables, then open the Scram Tasks table.

    3. On the top menu, click on DataExport data. Once the export has been successfully completed, click on Download exported data.

    4. Unzip the csv file.

    5. Switch to the environment you are deploying to.

    6. On the left menu, go to DataTables, then open the Scram Tasks table.

    7. On the top menu, click on Data> beside Get dataGet data from Excel.

      Image Removed
    8. Upload the csv file from step 4. If there are any mapping issues, fix them.

      Image Removed
    9. Click Import. Wait for the process to complete, then verify that the data was imported.

    Follow the same steps using the AP Task table instead.

    Flows

    Always use the existing connection references inside the APSD-PAPS Flows solution for each flow. If the connection reference for the connection doesn’t exist, create a new one inside the solution first. The connection reference should be connected to the generic account connections.

    ...

    Expand
    titleHow to copy a flow and include it in a solution
    1. Open the details screen of the flow you wish to copy.

    2. Click the Save As button.

    3. Give it a new name, and click Save.

    4. Go to your My Flows section, and the new flow should be there in a disabled state.​

    5. Go into the details page, and click Edit.

    6. Delete the Manually Trigger a Flow trigger.

      • Note: This will delete any variables which this trigger contained

    7. ​Select the Power Virtual Agents > When Power Virtual Agents calls a flow trigger.

      • We use this as it requires no inputs to be defined.

    8. ​Save the flow.

    9. Go back to the Solutions section and select the solution into which you want to import the copied flow.

    10. Click Add Existing > Flow Outside Solutions.

    11. Select your flow and click Add.​

    12. Edit the flow and swap out the trigger with the Manually Trigger a Flow trigger.

    13. Fix any trigger variables which were wiped out during the copy operation.

    https://powerusers.microsoft.com/t5/General-Power-Automate/Add-existing-flows-to-Solutions/td-p/258103/page/2

    ...

    Migrating Changes Between Existing Environments

    Note

    Data will not be migrated between environments through the solution. You will need to perform data migration separately following the steps below.

    Expand
    titleExport the solution from DEV
    Info

    Most deployments will only require the APSD and Flows solutions to be migrated.

    • Custom Connectors solution must only be migrated if there are any changes to the existing custom connectors or a new custom connector is added.

    • Env Variables solution must only be migrated if new environment variables are added.

    Version number format: major.minor.build.revision number

    1. Open the Power Apps Studio and select the ap-dev-tcd365 environment.

    2. Select the solution you need to migrate.

    3. Click ExportPublishNext.

    4. Increase the version number as needed (revision # is automatically increased).

    5. Select corresponding export as type, then click on Export.

      • Managed: APSD, APSD-PAPS Admin, DataVerse-Security Role

      • Unmanaged: APSD-PAPS Flows, APSD-PAPS Custom Connectors, APSD-PAPS Env Variables

    6. Download the exported file.

    7. Repeat steps 2-6 for any other solutions required.

    Expand
    titleImport the solution
    Note

    Solution Import Order Must be followed or else will break dependencies
    APSD-PAPS Env Variables > APSD-PAPS Custom Connectors > APSD > APSD-PAPS Flows > APSD-PAPS Admin

    Only import the exported solutions from the previous section.

    Ideally, all imports would be with the APSD Generic Account. For PROD, this must be followed.

    Steps to login and use this account are in here: Creating connections for Do Not Reply APSD / Ne Pas Répondre PAPS

    Note

    If importing the APSD Custom Connectors solution:
    Even if there are no edits to make, as a final step, you must still go in to edit it and click on Update Connector for it to connect properly.

    1. Go to the desired environment.

    2. Click on Solutions on the left-hand menu and then Import in the top menu bar.

    3. Select Browse and point to the zip file, e.g. APSD_PAPS_EnvVariables_1_0_0_X.zip, created in the export solution steps.

    4. Click Import and wait for the process to finish.

    5. Import the rest of the solutions as needed.

    6. Click on Publish all customizations.

    7. Verify that all the required flows are turned on (flows are inside Flows and Admin solutions).

    If any of the flows are off:

    1. Select the flow and click Turn on.

    2. If there is an error, select the flow and click Edit.

    3. If you are brough to a screen asking to confirm the flow connections, ensure all are using the connection references inside the solution then click Continue.

      Image Added
    4. Once you are brought to the flow screen, click Save.

    5. Steps 6 - 9 are only for certain flows (e.g. those with a manual trigger).

    6. Go back to the solution and click on the flow name to view its details.

    7. Click on Edit in the Run only users section.

      Image Added
    8. Ensure that all the connections are using the generic account connections and NOT “Provided by run only user”.

      Image Added
    9. Click Save.

    10. Click Turn on.

    11. Repeat steps 1-10 for any other flows that are not on.

    Importing/Migrating Data

    When setting up a new environment, all lookup data must be brought into the environment. This can be done either through creating a dataflow to migrate data between environments or by importing the data from an Excel spreadsheet.

    Expand
    titleImporting task data - Export to Excel then import [NOT RECOMMENDED]
    Warning

    NOT RECOMMENDED METHOD

    Info

    Alternative solution: Follow https://docs.microsoft.com/en-us/powerapps/developer/data-platform/dataverse-odata-dataflows-migration to create a dataflow to migrate the data between environments. This currently exists for QA → ACC.

    1. Go to the environment that has the master set of data for the SCRAM tasks. Currently, this is QA.

    2. On the left menu, go to DataTables, then open the Scram Tasks table.

    3. On the top menu, click on DataExport data. Once the export has been successfully completed, click on Download exported data.

    4. Unzip the csv file.

    5. Switch to the environment you are deploying to.

    6. On the left menu, go to DataTables, then open the Scram Tasks table.

    7. On the top menu, click on Data> beside Get dataGet data from Excel.

      Image Added
    8. Upload the csv file from step 4. If there are any mapping issues, fix them.

      Image Added
    9. Click Import. Wait for the process to complete, then verify that the data was imported.

    Follow the same steps using the AP Task table instead.

    Flows

    Always use the existing connection references inside the APSD-PAPS Flows solution for each flow. If the connection reference for the connection doesn’t exist, create a new one inside the solution first. The connection reference should be connected to the generic account connections.

    ...

    Expand
    titleHow to copy a flow and include it in a solution
    1. Open the details screen of the flow you wish to copy.

    2. Click the Save As button.

    3. Give it a new name, and click Save.

    4. Go to your My Flows section, and the new flow should be there in a disabled state.​

    5. Go into the details page, and click Edit.

    6. Delete the Manually Trigger a Flow trigger.

      • Note: This will delete any variables which this trigger contained

    7. ​Select the Power Virtual Agents > When Power Virtual Agents calls a flow trigger.

      • We use this as it requires no inputs to be defined.

    8. ​Save the flow.

    9. Go back to the Solutions section and select the solution into which you want to import the copied flow.

    10. Click Add Existing > Flow Outside Solutions.

    11. Select your flow and click Add.​

    12. Edit the flow and swap out the trigger with the Manually Trigger a Flow trigger.

    13. Fix any trigger variables which were wiped out during the copy operation.

    https://powerusers.microsoft.com/t5/General-Power-Automate/Add-existing-flows-to-Solutions/td-p/258103/page/2

    https://piyushksingh.com/2021/05/25/update-the-child-flow-for-action-run_a_child_flow-to-not-use-run-only-user-connections/

    Expand
    titleRejected Email Notification Flows

    Name: Timesheet rejected - Send email notification

    Description: This Power Automate Flow triggers when the “ap_timesheetstatus” field is modified to “Rejected”. The flow sends an email to the submitter.

    Name: Expense rejected - Send email notification

    Description: This Power Automate Flow triggers when the “ap_expensestatus” field is modified to “Rejected”. The flow sends an email to the submitter.

    Name: Invoice rejected - Send email notification

    Description: This Power Automate Flow triggers when the “ap_invoicestatus” field is modified to “Rejected”. The flow sends an email to the submitter.

    Expand
    titleTimesheet Approval – Add to CRSM Flow

    Name: Push Approved Time Entries To CRSM (TMAPI)

    Description: This Power Automate Flow triggers when the “ap_timsheetstatus” field is modified to “Approved”. The flow uses the “TMAPI” custom connector, specifically the following end points: 

    1. Add a time entry

      1. To add a time entry, the flow gets all the rows where the current timesheet is approved from the “Time Entries” table filtered via a FetchXML query to only get the rows where “Added to CRSM” is false and hours are not empty or null. Here’s the query:

        Code Block
        languagexml
        <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
          <entity name="ap_timeentry">
            <attribute name="ap_timeentryid" />
            <attribute name="ap_timeid" />
            <attribute name="createdon" />
            <order attribute="ap_timeid" descending="false" />
            <filter type="and">
              <condition attribute="ap_addedtocrsm" operator="eq" value="0" />
              <condition attribute="ap_timesheet" operator="eq" uitype="ap_timesheet" value="{@{triggerOutputs()?['body/ap_timesheetid']}}" />
              <condition attribute="ap_employeelogin" operator="eq" value="@{triggerOutputs()?['body/ap_employeelogin']}" />
              <condition attribute="ap_timecard" operator="eq" value="@{triggerOutputs()?['body/ap_reportingperiod']}" />
              <condition attribute="ap_timeentryhours" operator="not-null" />
            </filter>
          </entity>
        </fetch>

      2. Create a time entry record in the CRSM database.

    2. Add hours to time entry

      1. This endpoint is used to create a record for adding hours for the time entry that was created in the previous step. Depending upon the “ap_timeentrytype” i.e. “Regular”, “Travel” or “Other”, corresponding action is called. 

    3. At the end of the flow, the flag “Added to CRSM” is set to true in the Time Entries table. 

    Push Time Entry to CRSM Step inside flow

    TypeCode: Regular (REG), Travel (TH), Other (DH)

    Code Block
    [
      {
        "ServiceRequestId": @{int(variables('ServiceRequestID'))},
        "ServiceId": @{outputs('Get_a_row_by_ID')?['body/ap_serviceid']},
        "ApproverNetworkId": @{triggerOutputs()?['body/ap_approvedby']},
        "Comment": @{items('Apply_to_each_-_Push_to_CRSM')?['ap_comments']},
        "SubmitterNetworkId": @{items('Apply_to_each_-_Push_to_CRSM')?['ap_employeelogin']},
        "DateTime": @{items('Apply_to_each_-_Push_to_CRSM')?['ap_timeentrydate']},
        "Hours": [
          {
            "Quantity": @{items('Apply_to_each_-_Push_to_CRSM')?['ap_timeentryhours']},
            "TypeCode": "REG",
            "IsBillable": @{items('Apply_to_each_-_Push_to_CRSM')?['ap_billable']},
            "StatusCode": 2
          }
        ]
      }
    ]
    Expand
    titleImporting Users and Setting Roles Flow

    Name:Import User's Role & Manager (from Excel file)

    Description: This Power Automate Flow can be manually triggered to import users from an Excel file (see screenshot below) into the Dynamics 365 “Users” table in the target environment. The Flow also associates users with their managers as listed in the Excel file and assigns them the roles as per the Excel file. This Excel file can be stored on the executing user’s OneDrive.  

    Image RemovedImage Removed

    ...

    's Role & Manager (from Excel file)

    Description: This Power Automate Flow can be manually triggered to import users from an Excel file (see screenshot below) into the Dynamics 365 “Users” table in the target environment. The Flow also associates users with their managers as listed in the Excel file and assigns them the roles as per the Excel file. This Excel file can be stored on the executing user’s OneDrive.  

    Image AddedImage Added

    Archived Sections

    Expand
    titleIf any of the flows are off [ARCHIVED]
    Note

    Archived since these flows are no longer used

    If ‘Modify Users’ flow is off, turn on ‘Remove User’ and ‘Update User’ flows first (if not already on).

    1. Select the flow and click Turn on.

    2. If there is an error, select the flow and click Edit.

    3. If you are brough to a screen asking to confirm the flow connections, ensure all are using the connection references inside the solution then click Continue.

      Image Added
    4. Once you are brought to the flow screen, click Save.

    5. Steps 6 - 9 are only for certain flows (e.g. those with a manual trigger).

    6. Go back to the solution and click on the flow name to view its details.

    7. Click on Edit in the Run only users section.

      Image Added
    8. Ensure that all the connections are using the generic account connections and NOT “Provided by run only user”.

      Image Added
    9. Click Save.

    10. Click Turn on.

    11. Repeat steps 1-10 for any other flows that are not on.

    Expand
    titleUpdate connectors and dropdowns in the Canvas app - NO LONGER REQUIRED
    Warning

    IGNORE THIS SECTION
    Not necessary anymore now that the custom connectors are inside solutions.

    1. Edit the APSD-PAPS Canvas app.

    2. When prompted, select Don't Allow.

    3. Remove all connections that are showing as not connected - 5 connections (APSR, MTAPI, SIAPI, SPAPI, TMAPI), Office365Users and APSD_Translations.

    4. Add all of them back.

    5. SharePoint data connector: for APSD_Translation file. In the box enter the following URL: https://034gc.sharepoint.com/sites/DSD-CivilAviation/Lists/APSD_Translations/AllItems.aspx

    6. Check off the APSD_Translations list & click Connect.

    7. Run the App Checker and ensure no errors are reported.

    8. Turn on “Allow searching” in the properties for the following elements:

      • New Service Request Step One Screen - cboNapaProject element

      • New Service Request Step Three Contact Info Screen - cboFindOrganizationAlt element

      • Service Request Review Screen - ddSRRChangeReAssignment element

      • New Invoice Step One Screen - cboInvoiceCustomer and cboCustomerAddress elements

      • Weekly Time Entry Normalized Screen - cmbProject

    9. Save and Publish the app.

    ...