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.
- Click Custom Connectors
- Click "New custom connector"
- Click "Create from Blank"
- Enter Connector name. Eg Fluid
- Click "Continue"
- Enter a description for the connector. eg "Fluid Connnector"
- Select "https" for the scheme
- Enter your Fluid domain. eg. domain.fluid.work
- Enter the base URL. which must be "/api"
- Click "Security".
- Select "Basic Authentication"
- User "Fluid Username" for the username field.
- Enter "Fluid Personal Access Token" for the password field. Follow the link to see how a Personal Access Token is created in Fluid.
- Click "Definition" to go to the next step.
- Create a new action by clicking "New Action"
- Enter "Gets Excel spreadsheet from Fluid" into the Summary field. (This should not contain full stops).
- Enter "Get Excel spreadsheet from Fluid in base64 format" into the Description field.
- Enter "GetProjectDetailExcel" into the Operation ID field. (This should be one word.)
- Click "Import from sample" to manually enter the request.
- Import the request. Select "GET"
- Enter the URL (make sure the domain is your Fluid instance)
- Click "Import"
- Scroll down to the response section, and click "Add default response"
- Enter the Json below into the response:
"Content": "base64 content",
- Click "Import" to create the response
- Click "Create Connector"
- Click Test.
- Click "New Connection"
- Enter your Fluid username.
- Enter your Personal Access Token which has been created on Fluid. (See the document on how to create a token)
- Click "Create".
- Go back to the custom connector page.
- Click "Edit" (Pencil) to open the edit connector page.
- Click "Test"
- Select the "GetProjectDetailExcel" from the operations. (All the fields can be left empty.)
- Click "Test operation".
- You have successfully created a Connector in Power Apps.
Create a Flow in Power Apps
- Click "Flows"
- Click "New" and then "Scheduled - from blank" to create a new scheduled flow.
- Enter Flow name "Create Excel In SharePoint from Fluid Project Details Export"
- Click "Create"
- Expand the Recurrence by clicking on the banner.
- Select the frequency to "Week"
- Select "Monday" from On these days.
- Close the expanded Recurrence by clicking on the banner.
- Click "New Step"
- Select "Custom" and then "Fluid".
- Select "Gets Excel spreadsheet from Fluid"
- 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.
- Click Save to save work
- Click "New Step"
- Type "SharePoint" into the search bar.
- Select "SharePoint"
- Select "Create File"
- Select your SharePoint Site from the dropdown.
- Enter your Folder path - this is where the Excel file will be created.
- Use the dynamic variable "Name" for the file name. This will use the name Generated in Fluid.
- 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:
- Click update - this will bring the expression into the create file dialog.
- Click "Save"
- Click "Save" at the top right of the screen.
- Click "Test" at the top right of the screen.
- Select "I'll perform the trigger action"
- Click "Test"
- Click "Run Flow"
- Click "Done" - The flow should have executed successfully.
- Confirm file is generated in SharePoint.
- An Excel file containing Project Details is successfully created in SharePoint.