Transfer data between DB and CDS on Power Apps

少年辛苦终身事,莫向光阴惰寸功。这篇文章主要讲述Transfer data between DB and CDS on Power Apps相关的知识,希望能为你提供帮助。

    1. 鏍囩锛?a href='http://www.mamicode.com/so/1/win' title='win'>win      create      appear      earlier      base      one      instance      ssi      sof     
      Transfer data from Hospital to Regional SystemMicrosoft provides you the following solutions for emergency response:
      • The  Hospital Emergency Response solution  enables you to collect data for situational awareness of available beds and supplies, COVID-19 related patients, staffing, and pending discharges at a  hospital level.
      • The  Regional Government Emergency Response and Monitoring solution  enables you to collect data for situational awareness of available beds and supplies, COVID-19 related patients, staffing, and pending discharges at a  regional health organization level. Each hospital under the regional organization jurisdiction can submit their data by using the regional organization鈥榮 portal, which is also part of the  Regional Government Emergency Response and Monitoring solution.
      Hospital Emergency Response solution customers can transfer their hospital data to the regional medical organizations that have Regional Government Emergency Response and Monitoring solution.
      The out-of-box solution uses the Secure File Transfer Protocol (SFTP) as the data transmission mechanism. Customers can use other ways to transfer data to/from these solutions such as  importing and exporting data as CSV files  and  using web services  to programmatically interact with data in Microsoft Dataverse, which is the underlying data store for these solutions.
      This article provides information about how to use SFTP to do the data transfer.
      How does the data transfer happen?This is how the data transfer happens:
      1. Hospitals can publish their data from the hospital solution, such as information about beds, supplies, equipment, and staff, to a folder in an SFTP server hosted by their regional medical organization. Hospitals can publish data on-demand or can schedule it.
      2. The hospital data published in the folder on the SFTP server is automatically downloaded to the regional solution and is used to create respective data records (beds, supplies, equipment, and staff) for the hospital in the regional solution.
      PrerequisitesThese are the prerequisites for the data transfer to work successfully.
      • SFTP server: The regional health organization must have an SFTP server configured with a folder for each hospital on the SFTP server where the hospital can publish their data. The hospital must get the credentials from regional health organization to connect to the folder on the SFTP server.
        For information about creating an SFTP server, see  SFTP on Azure
      • CDC Short Name: Each  Supply  and  Staffing Type  record must have the  CDC Short Name  value. You can create and manage these records in the  Admin app  of hospital and regional solutions.
      • DOH Number: Each  Facility  record must have a valid  DOH Number  value. You can create and manage these records in the  Admin app  of hospital and regional solutions.
      Configure your solutions for data transferIT admins need to perform some steps to configure the data transfer from Hospital Emergency Response solution to SFTP server and from SFTP server to Regional Government Emergency Response and Monitoring solution.
      • Step 1: Create connections
      • Step 2: Enable flows for publishing data to SFTP (Hospital)
      • Step 3: Specify the data publish schedule (Hospital)
      • Step 4: Enable flow for pulling hospital data from SFTP (Regional)
      Step 1: Create connections
      Both the hospital and regional systems use Power Automate flows to transfer data between the hospital/regional solutions and SFTP server. In this step, we will create connections for Dataverse and SFTP to be used by flows for data transfer.
      This step is required for both hospital and regional solutions.
        Important
      Make sure that you create connections in your Power Apps environment before installing the hospital and regional emergency response solutions or upgrading to the latest version. This will save you a lot of steps later while enabling flows that get installed as part of these solutions.
      1. Sign in to  Power Apps.
      2. From the top-right corner, select your hospital or regional environment.
      3. From the left navigation pane, expand  Data  and select  Connections.
      4. Select  New Connection, and then type  Common Data Service  in the search box.
      5. From the search results, select  +  next to  Common Data Service  connector to add a connection.
        Transfer data between DB and CDS on Power Apps

        文章图片

      6. On the next screen, select  Create. Select or specify the credentials to create the connector. On successful authentication, your connection will be created.
      7. Select  New Connection, and then type  Common Data Service  in the search box.
      8. 【Transfer data between DB and CDS on Power Apps】From the search results, select  +  next to  Dataverse (current environment)  connector to add a connection.
      9. On the next screen, select  Create. Select or specify the credentials to create the connector. On successful authentication, your connection will be created.
      10. Select  New Connection, and then type  SFTP  in the search box.
      11. From the search results, select  +  next to  SFTP - SSH  connector to add a connection.
        Transfer data between DB and CDS on Power Apps

        文章图片

      12. In the  SFTP - SSH  dialog box, provide the credentials to connect to the folder on the SFTP server. These details would have been already provided to you by your regional health organization as mentioned earlier in the  Prerequisites  section.
      13. Select  Create. Power Apps validates the connection details, and on successful authentication, creates an SFTP connection.
      At the end of this step, you should have three connections: two for Dataverse and one for SFTP.
      Step 2: Enable flows for publishing data to SFTP (Hospital)
      This step has to be performed by the admins of the Hospital Emergency Response solution after they have installed the solution.
      In this step, we will enable the following flows that will publish reviewed data from the hospital solution to SFTP server on a set schedule and on-demand:
      • Publish Bed Census Data
      • Publish COVID Data
      • Publish Data for All Facilities
      • Publish Equipment Needs Data
      • Publish Staff Updates
      • Publish Supply Item Details
      • Update Sync Census
      • Update Sync Equipment Needs
      To enable these flows:
      1. Sign into  Power Automate.
      2. From the left pane, select  Solutions.  From the solution list, select  Hospital Emergency Response Solution  to open the solution.
      3. In the solution, filter on  Flow  to find all the flows.
        Transfer data between DB and CDS on Power Apps

        文章图片

      4. Select a flow name to open the flow definition. For example, select  Publish Bed Census Data.
      5. Select  Edit  on the toolbar and verify the embedded connections for this flow. These should be the same connections that you created earlier.
      6. Select  Save  to save the changes, and then select  Turn On.
      7. Repeat steps 4-6 for other flows listed earlier.
      If you face any issues working with flows, try  Troubleshooting a flow.
      Step 3: Specify the data publish schedule (Hospital)
      The  Publish Data for All Facilities  flow contains the information about the data publish schedule. You can define the recurrence schedule when the flow will run automatically and publish the data that you have reviewed and marked as ready for publish.
      1. Sign into  Power Automate.
      2. From the left pane, select  Solutions.  From the solution list, select  Hospital Emergency Response Solution  to open the solution.
      3. In the solution, search for "Publish Data for". The  Publish Data for All Facilities  flow appears in the search result.
        Transfer data between DB and CDS on Power Apps

        文章图片

      4. Select the flow name to open the flow definition, and then select  Edit  in the toolbar.
      5. In the flow definition, select  Recurrence  and then select  Edit.
        Transfer data between DB and CDS on Power Apps

        文章图片

      6. Specify the data publish recurrence schedule.
        Transfer data between DB and CDS on Power Apps

        文章图片

      7. Select  Save  to save your changes.
      Step 4: Enable flow for pulling hospital data from SFTP (Regional)
      This step has to be performed by the admins of the Regional Government Emergency Response and Monitoring solution.
      In this step, we will enable the  Create Record when a File is Created in SFTP Location  flow that will automatically create a record for hospital in the regional solution based on the data uploaded from the hospital system in the SFTP server.
        Important
      For each hospital registering with regional organization to send data, the regional admins will need to do one of the following to ensure data for each hospital is copied from the SFTP server to the regional solution:
      • Copy data from all the hospitals to a single folder on the SFTP server to enable the  Create Record when a File is Created in SFTP Location  flow to copy all the data.
      • Create a copy of the  Create Record when a File is Created in SFTP Location  flow for each Hospital registering with them to send data, and in each flow instance change the SFTP server folder path as per the hospital. We鈥榣l show you how to do this later in this section.
      1. Sign into  Power Automate.
      2. From the left pane, select  Solutions.  From the solution list, select  Regional Emergency Response Solution  to open the solution.
      3. In the solution, filter on  Flow  to find all the flows.
        Transfer data between DB and CDS on Power Apps

        文章图片

      4. Select the  Create Record when a File is Created in SFTP Location  flow to open the flow definition.
      5. Verify the embedded connections for this flow. These should be the same connections that you created earlier.
      6. Select  Save  to save the changes, and then select  Turn On.
      7. If regional admins are expecting data from multiple hospitals that are stored in different folders on SFTP server, they can create copies of the  Create Record when a File is Created in SFTP Location  flow to create one for each hospital, and update the SFTP folder name accordingly in the copied flow instance. To do this:
        1. Select  Save As  on the toolbar to create a copy of the flow.
        2. Rename the flow accordingly and save it. This flow will become available under  My flows.
        3. Select the flow to open it for editing. Select  Edit  on the toolbar.
        4. Select  When a file is added or modified, and select appropriate value in the  Folder  field:
          Transfer data between DB and CDS on Power Apps

          文章图片

      8. Select  Save  to save the changes, and then select  Turn On.
      Review and publish data to SFTPAfter your IT admin has configured the solution for data transfer from the hospital solution, you can use the  Review and Publish Data  model-driven app to review the data and mark it as completed for publishing to the folder on the SFTP server.
      1. Sign in to  Power Apps.
      2. From the top-right corner, select your hospital environment.
      3. Select  Apps  in the left navigation pane, and then select the  Review and Publish Data  app.
      4. In the app, all the facilities are listed. Select a facility for which you want to review the data and publish. This will open the facility record.
        Transfer data between DB and CDS on Power Apps

        文章图片

      5. Scroll down the page to review the following data for your facility: Bed Census, COVID Stats, Equipment Needs, Supply Tracking, and Staff Updates. If necessary, update the data in grids, and then select the save icon to save your changes.
        Transfer data between DB and CDS on Power Apps

        文章图片

      6. Once reviewed, you can select a row of data, and select  Mark Complete. Select  OK  in the confirmation dialog box to complete the action.
        The record鈥榮 review status changes to  Completed.
        Transfer data between DB and CDS on Power Apps

        文章图片

      The scheduled flows will pick up the completed items for publishing to the SFTP folder that you configured earlier (Step 3: Specify the data publish schedule (Hospital)).
      Manually publish data
      The scheduled flow publishes data at a certain time, but what if you want to manually or immediately publish the data after reviewing it.
        1. In the  Review and Publish Data  app, select the record that you want to publish from the  Published History  in the left pane. All the published data for the selected entity are displayed. If you want to view the active records for the entity, use the view selector.
          Transfer data between DB and CDS on Power Apps

          文章图片

        2. In this case, we will publish the data that we reviewed in the previous section. So, select the  Active Bed Censusview, select the row that was marked as completed, and then select  Flow  >   Publish Bed Census Data.
          Transfer data between DB and CDS on Power Apps

          文章图片

        3. On the next screen, review that the connections are valid, and select  Continue.
          Transfer data between DB and CDS on Power Apps

          文章图片

        4. On the next screen select  Run flow. A message appears stating that the flow run started successfully and how you can monitor the progress.


        推荐阅读