Skip to content

Commit e76c97c

Browse files
feat: adding sample coded action apps
Co-Authored-By: Claude <81847+claude@users.noreply.github.com>
1 parent 7f9e669 commit e76c97c

108 files changed

Lines changed: 37217 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
# TemplateWithDataFabric
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 [`Schema.json`](./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+
Lines changed: 254 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,254 @@
1+
{
2+
"entities": [
3+
{
4+
"name": "testEntity",
5+
"displayName": "testEntity",
6+
"entityTypeId": 0,
7+
"entityType": "Entity",
8+
"description": "",
9+
"folderId": "00000000-0000-0000-0000-000000000000",
10+
"fields": [
11+
{
12+
"id": "34240c7d-a468-f111-8fcb-0022482a9c89",
13+
"name": "Approved",
14+
"isPrimaryKey": false,
15+
"isForeignKey": false,
16+
"isExternalField": false,
17+
"isHiddenField": false,
18+
"fieldCategoryId": 0,
19+
"isUnique": false,
20+
"referenceType": "ManyToOne",
21+
"sqlType": {
22+
"name": "BIT",
23+
"lengthLimit": 100
24+
},
25+
"isRequired": false,
26+
"isEncrypted": false,
27+
"displayName": "Approved",
28+
"description": "",
29+
"createTime": "2026-06-15T10:25:11.993Z",
30+
"createdBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
31+
"updateTime": "2026-06-15T10:25:11.993Z",
32+
"updatedBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
33+
"isSystemField": false,
34+
"isAttachment": false,
35+
"isRbacEnabled": false,
36+
"isModelReserved": false
37+
},
38+
{
39+
"id": "f75655aa-e764-f111-8fcb-0022483118a6",
40+
"name": "LoanDocument",
41+
"isPrimaryKey": false,
42+
"isForeignKey": true,
43+
"isExternalField": false,
44+
"isHiddenField": false,
45+
"fieldCategoryId": 0,
46+
"isUnique": false,
47+
"referenceName": "fk_LoanDocument_b835da76-1ec2-4420-8474-3d68586551e0",
48+
"referenceEntity": {
49+
"name": "EntityAttachment",
50+
"displayName": "EntityAttachment",
51+
"entityTypeId": 2,
52+
"entityType": "InternalEntity",
53+
"folderId": "00000000-0000-0000-0000-000000000000",
54+
"isRbacEnabled": false,
55+
"isInsightsEnabled": false,
56+
"invalidIdentifiers": [],
57+
"isModelReserved": false,
58+
"id": "ea5655aa-e764-f111-8fcb-0022483118a6"
59+
},
60+
"referenceField": {
61+
"id": "170fa3e1-2a31-4da0-891d-027b8f14ddf5",
62+
"definition": {
63+
"id": "170fa3e1-2a31-4da0-891d-027b8f14ddf5",
64+
"name": "Name",
65+
"isPrimaryKey": false,
66+
"isForeignKey": false,
67+
"isExternalField": false,
68+
"isHiddenField": false,
69+
"fieldCategoryId": 0,
70+
"isUnique": false,
71+
"referenceType": "ManyToOne",
72+
"sqlType": {
73+
"name": "NVARCHAR",
74+
"lengthLimit": 4000
75+
},
76+
"isRequired": false,
77+
"isEncrypted": false,
78+
"displayName": "Name",
79+
"createTime": "2026-06-10T16:16:06.943Z",
80+
"updateTime": "2026-06-10T16:16:06.943Z",
81+
"isSystemField": false,
82+
"isAttachment": false,
83+
"isRbacEnabled": false,
84+
"isModelReserved": false
85+
}
86+
},
87+
"referenceType": "ManyToOne",
88+
"sqlType": {
89+
"name": "UNIQUEIDENTIFIER"
90+
},
91+
"isRequired": false,
92+
"isEncrypted": false,
93+
"displayName": "Loan Document",
94+
"description": "",
95+
"createTime": "2026-06-10T16:16:08.537Z",
96+
"createdBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
97+
"updateTime": "2026-06-10T16:16:08.537Z",
98+
"updatedBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
99+
"isSystemField": false,
100+
"fieldDisplayType": "File",
101+
"isAttachment": false,
102+
"isRbacEnabled": false,
103+
"isModelReserved": false
104+
},
105+
{
106+
"id": "818a9ab0-e764-f111-8fcb-0022483118a6",
107+
"name": "ApplicantName",
108+
"isPrimaryKey": false,
109+
"isForeignKey": false,
110+
"isExternalField": false,
111+
"isHiddenField": false,
112+
"fieldCategoryId": 0,
113+
"isUnique": false,
114+
"referenceType": "ManyToOne",
115+
"sqlType": {
116+
"name": "NVARCHAR",
117+
"lengthLimit": 200
118+
},
119+
"isRequired": false,
120+
"isEncrypted": false,
121+
"displayName": "Applicant name",
122+
"description": "",
123+
"createTime": "2026-06-10T16:16:09.83Z",
124+
"createdBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
125+
"updateTime": "2026-06-10T16:16:09.83Z",
126+
"updatedBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
127+
"isSystemField": false,
128+
"isAttachment": false,
129+
"isRbacEnabled": false,
130+
"isModelReserved": false
131+
},
132+
{
133+
"id": "828a9ab0-e764-f111-8fcb-0022483118a6",
134+
"name": "LoanAmount",
135+
"isPrimaryKey": false,
136+
"isForeignKey": false,
137+
"isExternalField": false,
138+
"isHiddenField": false,
139+
"fieldCategoryId": 0,
140+
"isUnique": false,
141+
"referenceType": "ManyToOne",
142+
"sqlType": {
143+
"name": "NVARCHAR",
144+
"lengthLimit": 200
145+
},
146+
"isRequired": false,
147+
"isEncrypted": false,
148+
"displayName": "Loan Amount",
149+
"description": "",
150+
"createTime": "2026-06-10T16:16:10.337Z",
151+
"createdBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
152+
"updateTime": "2026-06-10T16:16:10.337Z",
153+
"updatedBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
154+
"isSystemField": false,
155+
"isAttachment": false,
156+
"isRbacEnabled": false,
157+
"isModelReserved": false
158+
},
159+
{
160+
"id": "838a9ab0-e764-f111-8fcb-0022483118a6",
161+
"name": "CreditScore",
162+
"isPrimaryKey": false,
163+
"isForeignKey": false,
164+
"isExternalField": false,
165+
"isHiddenField": false,
166+
"fieldCategoryId": 0,
167+
"isUnique": false,
168+
"referenceType": "ManyToOne",
169+
"sqlType": {
170+
"name": "NVARCHAR",
171+
"lengthLimit": 200
172+
},
173+
"isRequired": false,
174+
"isEncrypted": false,
175+
"displayName": "Credit Score",
176+
"description": "",
177+
"createTime": "2026-06-10T16:16:10.84Z",
178+
"createdBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
179+
"updateTime": "2026-06-10T16:16:10.84Z",
180+
"updatedBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
181+
"isSystemField": false,
182+
"isAttachment": false,
183+
"isRbacEnabled": false,
184+
"isModelReserved": false
185+
},
186+
{
187+
"id": "18248eff-e764-f111-8fcb-0022483118a6",
188+
"name": "RiskFactor",
189+
"isPrimaryKey": false,
190+
"isForeignKey": false,
191+
"isExternalField": false,
192+
"isHiddenField": false,
193+
"fieldCategoryId": 0,
194+
"isUnique": false,
195+
"referenceType": "ManyToOne",
196+
"sqlType": {
197+
"name": "NVARCHAR",
198+
"lengthLimit": 200
199+
},
200+
"isRequired": false,
201+
"isEncrypted": false,
202+
"displayName": "Risk Factor",
203+
"description": "",
204+
"createTime": "2026-06-10T16:18:22.29Z",
205+
"createdBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
206+
"updateTime": "2026-06-10T16:18:22.29Z",
207+
"updatedBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
208+
"isSystemField": false,
209+
"isAttachment": false,
210+
"isRbacEnabled": false,
211+
"isModelReserved": false
212+
},
213+
{
214+
"id": "19248eff-e764-f111-8fcb-0022483118a6",
215+
"name": "ReviewerComments",
216+
"isPrimaryKey": false,
217+
"isForeignKey": false,
218+
"isExternalField": false,
219+
"isHiddenField": false,
220+
"fieldCategoryId": 0,
221+
"isUnique": false,
222+
"referenceType": "ManyToOne",
223+
"sqlType": {
224+
"name": "NVARCHAR",
225+
"lengthLimit": 200
226+
},
227+
"isRequired": false,
228+
"isEncrypted": false,
229+
"displayName": "Reviewer Comments",
230+
"description": "",
231+
"createTime": "2026-06-10T16:18:22.94Z",
232+
"createdBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
233+
"updateTime": "2026-06-10T16:18:22.94Z",
234+
"updatedBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
235+
"isSystemField": false,
236+
"isAttachment": false,
237+
"isRbacEnabled": false,
238+
"isModelReserved": false
239+
}
240+
],
241+
"recordCount": 0,
242+
"isRbacEnabled": false,
243+
"isInsightsEnabled": false,
244+
"invalidIdentifiers": [],
245+
"isModelReserved": false,
246+
"id": "e05655aa-e764-f111-8fcb-0022483118a6",
247+
"createdBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
248+
"createTime": "2026-06-10T16:16:03.793Z",
249+
"updateTime": "2026-06-15T10:25:12.013Z",
250+
"updatedBy": "59984564-2907-4c32-901d-b23f54bc4ad8"
251+
}
252+
],
253+
"choicesets": []
254+
}
Binary file not shown.

0 commit comments

Comments
 (0)