|
| 1 | +# Action App With Data Fabric Entity |
| 2 | + |
| 3 | +A UiPath Coded Action App template for **Loan Application Review** backed by a **Data Fabric** entity. Reviewers can fetch an applicant's record by name, assess the applicant's details, view the bundled Loan Document attachment, and complete the task with an Approve or Reject decision — writing the risk factor, reviewer comments, and approval back to the Data Fabric entity. |
| 4 | + |
| 5 | +This template demonstrates how to read from and write to a Data Fabric entity and how to view entity file attachments in coded action apps. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## Pre-requisites |
| 10 | + |
| 11 | +- **Node.js** 20.x or later |
| 12 | +- **npm** 8.x or later |
| 13 | +- A **UiPath Automation Cloud** tenant with: |
| 14 | + - A non-confidential **External Application** (OAuth client) registered with the following: |
| 15 | + - Scopes: |
| 16 | + - `DataFabric.Schema.Read` (to read the entity schema) |
| 17 | + - `DataFabric.Data.Read` (to read entity records) |
| 18 | + - `DataFabric.Data.Write` (to update entity records) |
| 19 | + - Redirect URI `https://cloud.uipath.com/<orgId>/<tenantId>/actions_` (It is added automatically the first time any coded action app using this external application is deployed) |
| 20 | +- Install [UiPath CLI](https://github.com/UiPath/cli#installation) |
| 21 | + |
| 22 | + ```bash |
| 23 | + npm i -g @uipath/cli |
| 24 | + ``` |
| 25 | + |
| 26 | +--- |
| 27 | + |
| 28 | +## Setup |
| 29 | + |
| 30 | +### 1. Install dependencies |
| 31 | + |
| 32 | +```bash |
| 33 | +npm install |
| 34 | +``` |
| 35 | + |
| 36 | +### 2. Create the Data Fabric entity |
| 37 | + |
| 38 | +This template expects a Data Fabric entity with the fields described in [`df-entity-schema.json`](./df-entity-schema.json). Create the entity in **Data Fabric** (or import the schema) before deploying the app. The entity exposes the following fields: |
| 39 | + |
| 40 | +| Field | Type | Description | |
| 41 | +|---|---|---| |
| 42 | +| `ApplicantName` | string | Full name of the loan applicant | |
| 43 | +| `LoanAmount` | string | Requested loan amount | |
| 44 | +| `CreditScore` | string | Applicant's credit score | |
| 45 | +| `RiskFactor` | string | Reviewer-assigned risk score (0–10) | |
| 46 | +| `ReviewerComments` | string | Free-text notes from the reviewer | |
| 47 | +| `Approved` | boolean | Approval decision written back on completion | |
| 48 | +| `LoanDocument` | file | File attachment containing the loan document | |
| 49 | + |
| 50 | +### 3. Configure `uipath.json` |
| 51 | + |
| 52 | +Open `uipath.json` and update the clientId: |
| 53 | + |
| 54 | +```json |
| 55 | +{ |
| 56 | + "scope": "DataFabric.Schema.Read DataFabric.Data.Read DataFabric.Data.Write", |
| 57 | + "clientId": "<external-application-clientId>" |
| 58 | +} |
| 59 | +``` |
| 60 | + |
| 61 | +- **`clientId`** — the App ID of your registered External Application in UiPath Cloud |
| 62 | +- **`scope`** - the scopes required by the app. This must be a subset of the scopes granted to the external client above. |
| 63 | + |
| 64 | +### 4. Deploy to UiPath Cloud |
| 65 | + |
| 66 | +Build and deploy using the [`UiPath CLI`](https://uipath.github.io/uipath-typescript/coded-apps/getting-started/#deploy): |
| 67 | + |
| 68 | +```bash |
| 69 | +uip login |
| 70 | +npm run build |
| 71 | +uip codedapp pack dist -n <appName> --version 1.0.0 |
| 72 | +uip codedapp publish --type Action |
| 73 | +uip codedapp deploy |
| 74 | +``` |
| 75 | + |
| 76 | +--- |
| 77 | + |
| 78 | +## Action Schema |
| 79 | + |
| 80 | +The action schema that drives this app expects the following inputs and produces the following outputs (defined in `action-schema.json`). |
| 81 | + |
| 82 | +### Inputs |
| 83 | + |
| 84 | +| Field | Type | Required | Description | |
| 85 | +|---|---|---|---| |
| 86 | +| `applicantName` | string | Yes | Full name of the loan applicant used to look up the Data Fabric record | |
| 87 | + |
| 88 | +### Outputs |
| 89 | + |
| 90 | +| Field | Type | Required | Description | |
| 91 | +|---|---|---|---| |
| 92 | +| `riskFactor` | integer | Yes | Reviewer-assigned risk score (0–10) | |
| 93 | +| `reviewerComments` | string | No | Free-text notes from the reviewer | |
| 94 | + |
| 95 | +### Outcomes |
| 96 | + |
| 97 | +| Outcome | Triggered by | |
| 98 | +|---|---| |
| 99 | +| `Approve` | Clicking the **Approve** button | |
| 100 | +| `Reject` | Clicking the **Reject** button | |
| 101 | + |
| 102 | +--- |
| 103 | + |
| 104 | +## Viewing the coded action app in Action Center |
| 105 | + |
| 106 | +1. Import the [Template With Data Fabric Entity.uis](./Template%20With%20Data%20Fabric%20Entity.uis) solution in **Studio Web**. |
| 107 | + |
| 108 | + <img width="3836" height="1977" alt="Screenshot 2026-03-10 174451" src="https://github.com/user-attachments/assets/36046521-a49c-49f6-b103-01164828d6fb" /> |
| 109 | + |
| 110 | +2. In the **Properties** panel of the User Task node, update the **Action App** field to point to your deployed coded action app. |
| 111 | + |
| 112 | + <img width="3832" height="1943" alt="Screenshot 2026-06-16 030652" src="https://github.com/user-attachments/assets/29bc562b-ba91-481c-9ef4-7d93a1178d4c" /> |
| 113 | + |
| 114 | +3. Click **Debug** and enter the input arguments to run the process — this will create an Action Center task backed by your app. |
| 115 | +4. Open Action Center and complete the task to verify the full flow end-to-end. |
| 116 | + |
| 117 | +--- OR --- |
| 118 | + |
| 119 | +Create the task using an RPA workflow in **Studio Desktop** that uses the **Create App Task** activity, pointing to your deployed coded action app and passing the required inputs. |
| 120 | + |
| 121 | +<img width="3838" height="1875" alt="Screenshot 2026-03-10 182414" src="https://github.com/user-attachments/assets/5c72d051-bb7c-4cb4-a23a-2751ffda3e69" /> |
| 122 | + |
| 123 | +--- |
| 124 | + |
| 125 | +## Expected Results |
| 126 | + |
| 127 | +When the app loads inside Action Center: |
| 128 | + |
| 129 | +1. **Review Form tab** — Fetches the Data Fabric record for the provided applicant name and displays the applicant name, loan amount, and credit score (read-only). The reviewer fills in the **Risk Factor** (integer 0–10, required) and optional **Reviewer Comments**, then clicks **Approve** or **Reject** to complete the task. The risk factor, reviewer comments, and approval decision are written back to the Data Fabric entity. |
| 130 | + |
| 131 | +2. **Document tab** — Retrieves and renders the Loan Document attached to the entity record for reference. |
| 132 | + |
| 133 | +3. **Theme** — The app initializes in light or dark mode based on the Action Center theme preference and supports toggling via the button in the top-right corner. |
| 134 | + |
| 135 | +4. **Read-only mode** — If the task is already completed or the current user does not have edit access, all input fields are disabled and the Approve / Reject buttons are greyed out. |
| 136 | + |
| 137 | + |
| 138 | + |
| 139 | + |
| 140 | +https://github.com/user-attachments/assets/970a5d03-8989-4c0e-9bd3-70e61e114f0a |
| 141 | + |
| 142 | + |
0 commit comments