The steps below will show a developer how Power Apps can be integrated with Fluid. In the example below we will create a Power App that creates an Excel file containing a list of Project Details in SharePoint. 


Create a Personal Access Token in your Fluid instance

Follow the instructions to create a PAT in the document "Creating a Personal Access Token".


Use the PAT for authorisation in PowerApps.



Create a Custom Connector in Power Apps

We will first need to create a custom connector which links with your Fluid instance.


  1.    Click Custom Connectors

  2. Click "New custom connector"



  3. Click "Create from Blank"



  4. Enter Connector name. Eg Fluid



  5. Click "Continue"


  6. Enter a description for the connector. eg "Fluid Connnector"



  7. Select "https" for the scheme



  8. Enter your Fluid domain. eg. domain.fluid.work


  9. Enter the base URL. which must be "/api"


  10. Click "Security".


  11. Select "Basic Authentication"



  12. User "Fluid Username" for the username field.


  13. Enter "Fluid Personal Access Token" for the password field. Follow the link to see how a Personal Access Token is created in Fluid.


  14. Click "Definition" to go to the next step.


  15. Create a new action by clicking "New Action"



  16. Enter "Gets Excel spreadsheet from Fluid" into the Summary field. (This should not contain full stops).


  17. Enter "Get Excel spreadsheet from Fluid in base64 format" into the Description field.


  18. Enter "GetProjectDetailExcel" into the Operation ID field. (This should be one word.)



  19. Click "Import from sample" to manually enter the request.



  20. Import the request. Select "GET"

  21. Enter the URL (make sure the domain is your Fluid instance)

    eg: https://domain.fluid.work/api/Export/ExportExcel/fluidprojectloadfeed?exportstart=1601510400000&exportend=1604102400000&scenarioId=0&correlationid=28lm7tehlxo&includeSubProjects=false



  22. Click "Import"


  23. Scroll down to the response section, and click "Add default response"



  24. Enter the Json below into the response:
    {
        "Name": "fluidprojectloadfeed.xlsx",
        "Content": "base64 content",
        "Type": "application/vnd.ms-excel"
    }



  25. Click "Import" to create the response


  26. Click "Create Connector"



  27. Click Test.


  28. Click "New Connection"



  29. Enter your Fluid username.


  30. Enter your Personal Access Token which has been created on Fluid. (See the document on how to create a token)



  31. Click "Create".


  32. Go back to the custom connector page.


  33. Click "Edit" (Pencil) to open the edit connector page.



  34. Click "Test"


  35. Select the "GetProjectDetailExcel" from the operations. (All the fields can be left empty.)



  36. Click "Test operation".

  37. You have successfully created a Connector in Power Apps.



Create a Flow in Power Apps

  1. Click "Flows"



  2. Click "New"  and then "Scheduled - from blank" to create a new scheduled flow.



  3. Enter Flow name "Create Excel In SharePoint from Fluid Project Details Export"



  4. Click "Create"


  5. Expand the Recurrence by clicking on the banner.



  6. Select the frequency to "Week"

  7. Select "Monday" from On these days.

  8. Close the expanded Recurrence by clicking on the banner.

  9. Click "New Step"



  10. Select "Custom" and then "Fluid".



  11. Select "Gets Excel spreadsheet from Fluid"



  12. Select "No" for the includeSubProjects field. Other fields can be left empty.


    ExportStart - set to 0 or empty.
    ExportEnd - set to 0 or empty.
    ScenarioId - set to 0 or empty.
    CorrelationId - set to 0 or empty.
    IncludeSubProjects - set to false for no sub projects.


  13. Click Save to save work


  14. Click "New Step"


  15. Type "SharePoint" into the search bar.



  16. Select "SharePoint"



  17. Select "Create File"



  18. Select your SharePoint Site from the dropdown.


  19. Enter your Folder path - this is where the Excel file will be created.


  20. Use the dynamic variable "Name" for the file name. This will use the name Generated in Fluid.


  21. Use the expression helper to generate the data from base64 to binary.
    Select show more conversions and choose base64ToBinary then with the cursor inside the parenthesis select dynamic content and select the "Content" field. This will put the base64 file content in the field. A file will be created in SharePoint.

    Enter the following:
    base64ToBinary(outputs('Gets_Excel_spreadsheet_from_Fluid')?['body/Content'])



  22. Click update - this will bring the expression into the create file dialog.


  23. Click "Save"



  24. Click "Save" at the top right of the screen.



  25. Click "Test" at the top right of the screen.


  26. Select "I'll perform the trigger action"



  27. Click "Test"

  28. Click "Run Flow"



  29. Click "Done" - The flow should have executed successfully.



  30.  Confirm file is generated in SharePoint.



  31. An Excel file containing Project Details is successfully created in SharePoint.