Skip to content

Commit bf0cbad

Browse files
fixes
1 parent 83dc133 commit bf0cbad

4 files changed

Lines changed: 148 additions & 91 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Coded Action App Samples
2+
3+
A collection of UiPath **Coded Action App** samples, built with the `@uipath/coded-action-app` and `@uipath/uipath-typescript` SDKs. Every sample implements the same **Loan Application Review** action — a reviewer assesses an applicant and completes the task with an **Approve** or **Reject** decision — and each one demonstrates a different way of bringing the supporting document or data into the app.
4+
5+
Pick the sample that matches how your document/data is delivered, then open its folder and follow that README to set up and deploy.
6+
7+
## Choose a sample
8+
9+
| Sample | Use it when… | Demonstrates | Extra OAuth scopes |
10+
|--------|--------------|--------------|--------------------|
11+
| [`action-app-with-document`](./action-app-with-document) | The document ships **with the app** as a bundled asset | Rendering a bundled PDF alongside the review form | _None_ |
12+
| [`action-app-with-image`](./action-app-with-image) | You need to show a **bundled image** instead of a PDF | Rendering a bundled image alongside the review form | _None_ |
13+
| [`action-app-with-file-attachment-document`](./action-app-with-file-attachment-document) | The document arrives as a **direct file attachment** on the task | Previewing and downloading a task file attachment via `Attachments` | `OR.Folders.Read` |
14+
| [`action-app-with-storage-bucket-document`](./action-app-with-storage-bucket-document) | The document lives in an Orchestrator **Storage Bucket** | Looking up a bucket by name and fetching a file by path via `Buckets` | `OR.Buckets.Read` |
15+
| [`action-app-with-data-fabric-entity`](./action-app-with-data-fabric-entity) | Applicant data is stored in a **Data Fabric** entity | Reading an entity record, viewing its file attachment, and writing the decision back via `Entities` | `DataFabric.Schema.Read`, `DataFabric.Data.Read`, `DataFabric.Data.Write` |
16+
17+
## Common prerequisites
18+
19+
All samples share the same baseline:
20+
21+
- **Node.js** 20.x or later and **npm** 8.x or later
22+
- A **UiPath Automation Cloud** tenant
23+
- The [uip](https://github.com/UiPath/cli#installation) CLI: `npm i -g @uipath/cli`
24+
25+
The three data-backed samples (file attachment, storage bucket, data fabric) additionally require a non-confidential **External Application** (OAuth client) with the scopes listed above. See the individual sample README for the exact registration steps.
26+
27+
## Getting started
28+
29+
```bash
30+
cd <sample-folder>
31+
npm install
32+
```
33+
34+
Then follow the **Setup** section in that sample's README to build and deploy with the UiPath CLI.

samples/coded-action-apps/action-app-with-data-fabric-entity/df-entity-schema.json

Lines changed: 92 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"folderId": "00000000-0000-0000-0000-000000000000",
1010
"fields": [
1111
{
12-
"id": "34240c7d-a468-f111-8fcb-0022482a9c89",
13-
"name": "Approved",
12+
"id": "b3800989-bd69-f111-8fcb-0022482a9c89",
13+
"name": "ApplicantName",
1414
"isPrimaryKey": false,
1515
"isForeignKey": false,
1616
"isExternalField": false,
@@ -19,32 +19,92 @@
1919
"isUnique": false,
2020
"referenceType": "ManyToOne",
2121
"sqlType": {
22-
"name": "BIT",
23-
"lengthLimit": 100
22+
"name": "NVARCHAR",
23+
"lengthLimit": 200
24+
},
25+
"isRequired": true,
26+
"isEncrypted": false,
27+
"displayName": "Applicant Name",
28+
"description": "",
29+
"createTime": "2026-06-16T19:57:04.547Z",
30+
"createdBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
31+
"updateTime": "2026-06-16T19:57:04.547Z",
32+
"updatedBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
33+
"isSystemField": false,
34+
"isAttachment": false,
35+
"isRbacEnabled": false,
36+
"isModelReserved": false
37+
},
38+
{
39+
"id": "b4800989-bd69-f111-8fcb-0022482a9c89",
40+
"name": "LoanAmount",
41+
"isPrimaryKey": false,
42+
"isForeignKey": false,
43+
"isExternalField": false,
44+
"isHiddenField": false,
45+
"fieldCategoryId": 0,
46+
"isUnique": false,
47+
"referenceType": "ManyToOne",
48+
"sqlType": {
49+
"name": "DECIMAL",
50+
"lengthLimit": 1000,
51+
"maxValue": 1000000000000,
52+
"minValue": 0,
53+
"decimalPrecision": 2
2454
},
2555
"isRequired": false,
2656
"isEncrypted": false,
27-
"displayName": "Approved",
57+
"displayName": "Loan Amount",
2858
"description": "",
29-
"createTime": "2026-06-15T10:25:11.993Z",
59+
"createTime": "2026-06-16T19:57:05.06Z",
3060
"createdBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
31-
"updateTime": "2026-06-15T10:25:11.993Z",
61+
"updateTime": "2026-06-16T19:57:05.06Z",
3262
"updatedBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
3363
"isSystemField": false,
3464
"isAttachment": false,
3565
"isRbacEnabled": false,
3666
"isModelReserved": false
3767
},
3868
{
39-
"id": "f75655aa-e764-f111-8fcb-0022483118a6",
69+
"id": "b8800989-bd69-f111-8fcb-0022482a9c89",
70+
"name": "CreditScore",
71+
"isPrimaryKey": false,
72+
"isForeignKey": false,
73+
"isExternalField": false,
74+
"isHiddenField": false,
75+
"fieldCategoryId": 0,
76+
"isUnique": false,
77+
"referenceType": "ManyToOne",
78+
"sqlType": {
79+
"name": "DECIMAL",
80+
"lengthLimit": 1000,
81+
"maxValue": 1000000000000,
82+
"minValue": 0,
83+
"decimalPrecision": 2
84+
},
85+
"isRequired": false,
86+
"isEncrypted": false,
87+
"displayName": "Credit Score",
88+
"description": "",
89+
"createTime": "2026-06-16T19:57:05.553Z",
90+
"createdBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
91+
"updateTime": "2026-06-16T19:57:05.553Z",
92+
"updatedBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
93+
"isSystemField": false,
94+
"isAttachment": false,
95+
"isRbacEnabled": false,
96+
"isModelReserved": false
97+
},
98+
{
99+
"id": "bd800989-bd69-f111-8fcb-0022482a9c89",
40100
"name": "LoanDocument",
41101
"isPrimaryKey": false,
42102
"isForeignKey": true,
43103
"isExternalField": false,
44104
"isHiddenField": false,
45105
"fieldCategoryId": 0,
46106
"isUnique": false,
47-
"referenceName": "fk_LoanDocument_b835da76-1ec2-4420-8474-3d68586551e0",
107+
"referenceName": "fk_LoanDocument_0ca7134a-d79a-4b46-a4d4-f146ee54eaeb",
48108
"referenceEntity": {
49109
"name": "EntityAttachment",
50110
"displayName": "EntityAttachment",
@@ -92,9 +152,9 @@
92152
"isEncrypted": false,
93153
"displayName": "Loan Document",
94154
"description": "",
95-
"createTime": "2026-06-10T16:16:08.537Z",
155+
"createTime": "2026-06-16T19:57:06.89Z",
96156
"createdBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
97-
"updateTime": "2026-06-10T16:16:08.537Z",
157+
"updateTime": "2026-06-16T19:57:06.89Z",
98158
"updatedBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
99159
"isSystemField": false,
100160
"fieldDisplayType": "File",
@@ -103,62 +163,8 @@
103163
"isModelReserved": false
104164
},
105165
{
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",
166+
"id": "bf800989-bd69-f111-8fcb-0022482a9c89",
167+
"name": "Approved",
162168
"isPrimaryKey": false,
163169
"isForeignKey": false,
164170
"isExternalField": false,
@@ -167,24 +173,24 @@
167173
"isUnique": false,
168174
"referenceType": "ManyToOne",
169175
"sqlType": {
170-
"name": "NVARCHAR",
171-
"lengthLimit": 200
176+
"name": "BIT",
177+
"lengthLimit": 100
172178
},
173179
"isRequired": false,
174180
"isEncrypted": false,
175-
"displayName": "Credit Score",
181+
"displayName": "Approved",
176182
"description": "",
177-
"createTime": "2026-06-10T16:16:10.84Z",
183+
"createTime": "2026-06-16T19:57:08.153Z",
178184
"createdBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
179-
"updateTime": "2026-06-10T16:16:10.84Z",
185+
"updateTime": "2026-06-16T19:57:08.153Z",
180186
"updatedBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
181187
"isSystemField": false,
182188
"isAttachment": false,
183189
"isRbacEnabled": false,
184190
"isModelReserved": false
185191
},
186192
{
187-
"id": "18248eff-e764-f111-8fcb-0022483118a6",
193+
"id": "c0800989-bd69-f111-8fcb-0022482a9c89",
188194
"name": "RiskFactor",
189195
"isPrimaryKey": false,
190196
"isForeignKey": false,
@@ -194,24 +200,27 @@
194200
"isUnique": false,
195201
"referenceType": "ManyToOne",
196202
"sqlType": {
197-
"name": "NVARCHAR",
198-
"lengthLimit": 200
203+
"name": "DECIMAL",
204+
"lengthLimit": 1000,
205+
"maxValue": 10,
206+
"minValue": 0,
207+
"decimalPrecision": 0
199208
},
200209
"isRequired": false,
201210
"isEncrypted": false,
202211
"displayName": "Risk Factor",
203212
"description": "",
204-
"createTime": "2026-06-10T16:18:22.29Z",
213+
"createTime": "2026-06-16T19:57:08.65Z",
205214
"createdBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
206-
"updateTime": "2026-06-10T16:18:22.29Z",
215+
"updateTime": "2026-06-16T19:57:08.65Z",
207216
"updatedBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
208217
"isSystemField": false,
209218
"isAttachment": false,
210219
"isRbacEnabled": false,
211220
"isModelReserved": false
212221
},
213222
{
214-
"id": "19248eff-e764-f111-8fcb-0022483118a6",
223+
"id": "c3800989-bd69-f111-8fcb-0022482a9c89",
215224
"name": "ReviewerComments",
216225
"isPrimaryKey": false,
217226
"isForeignKey": false,
@@ -228,9 +237,9 @@
228237
"isEncrypted": false,
229238
"displayName": "Reviewer Comments",
230239
"description": "",
231-
"createTime": "2026-06-10T16:18:22.94Z",
240+
"createTime": "2026-06-16T19:57:09.15Z",
232241
"createdBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
233-
"updateTime": "2026-06-10T16:18:22.94Z",
242+
"updateTime": "2026-06-16T19:57:09.15Z",
234243
"updatedBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
235244
"isSystemField": false,
236245
"isAttachment": false,
@@ -243,10 +252,10 @@
243252
"isInsightsEnabled": false,
244253
"invalidIdentifiers": [],
245254
"isModelReserved": false,
246-
"id": "e05655aa-e764-f111-8fcb-0022483118a6",
255+
"id": "a6800989-bd69-f111-8fcb-0022482a9c89",
247256
"createdBy": "59984564-2907-4c32-901d-b23f54bc4ad8",
248-
"createTime": "2026-06-10T16:16:03.793Z",
249-
"updateTime": "2026-06-15T10:25:12.013Z",
257+
"createTime": "2026-06-16T19:57:01.3Z",
258+
"updateTime": "2026-06-16T19:57:09.15Z",
250259
"updatedBy": "59984564-2907-4c32-901d-b23f54bc4ad8"
251260
}
252261
],

samples/coded-action-apps/action-app-with-file-attachment-document/src/components/Form.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,6 @@ const Form = ({ onInitTheme, darkTheme, onToggleTheme }: FormProps) => {
139139

140140
return () => {
141141
cancelled = true;
142-
if (blobUrlRef.current) {
143-
URL.revokeObjectURL(blobUrlRef.current);
144-
blobUrlRef.current = null;
145-
}
146142
};
147143
}
148144
// `isLoadingDocument` is read only as a re-entrancy guard, so it is intentionally left out of
@@ -152,6 +148,17 @@ const Form = ({ onInitTheme, darkTheme, onToggleTheme }: FormProps) => {
152148
// eslint-disable-next-line react-hooks/exhaustive-deps
153149
}, [activeTab, hasLoadedDocument, formData]);
154150

151+
// Revoke the blob URL only when the component unmounts, so the PDF viewer keeps a valid
152+
// URL for the lifetime of the form.
153+
useEffect(() => {
154+
return () => {
155+
if (blobUrlRef.current) {
156+
URL.revokeObjectURL(blobUrlRef.current);
157+
blobUrlRef.current = null;
158+
}
159+
};
160+
}, []);
161+
155162

156163
const zoomIn = () => setScale((s) => Math.min(2.5, parseFloat((s + 0.2).toFixed(1))));
157164
const zoomOut = () => setScale((s) => Math.max(0.4, parseFloat((s - 0.2).toFixed(1))));

samples/coded-action-apps/action-app-with-storage-bucket-document/src/components/Form.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,6 @@ const Form = ({ onInitTheme, darkTheme, onToggleTheme }: FormProps) => {
150150

151151
return () => {
152152
cancelled = true;
153-
if (blobUrlRef.current) {
154-
URL.revokeObjectURL(blobUrlRef.current);
155-
blobUrlRef.current = null;
156-
}
157153
};
158154
}
159155
// `isLoadingDocument` is read only as a re-entrancy guard, so it is intentionally left out of
@@ -163,6 +159,17 @@ const Form = ({ onInitTheme, darkTheme, onToggleTheme }: FormProps) => {
163159
// eslint-disable-next-line react-hooks/exhaustive-deps
164160
}, [activeTab, hasLoadedDocument, formData, folderId]);
165161

162+
// Revoke the blob URL only when the component unmounts, so the PDF viewer keeps a valid
163+
// URL for the lifetime of the form.
164+
useEffect(() => {
165+
return () => {
166+
if (blobUrlRef.current) {
167+
URL.revokeObjectURL(blobUrlRef.current);
168+
blobUrlRef.current = null;
169+
}
170+
};
171+
}, []);
172+
166173

167174
const zoomIn = () => setScale((s) => Math.min(2.5, parseFloat((s + 0.2).toFixed(1))));
168175
const zoomOut = () => setScale((s) => Math.max(0.4, parseFloat((s - 0.2).toFixed(1))));

0 commit comments

Comments
 (0)