Skip to content

Commit 9fd3b2f

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

107 files changed

Lines changed: 27707 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: 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.
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
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+
Binary file not shown.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"inputs": {
3+
"type": "object",
4+
"properties": {
5+
"applicantName": {
6+
"type": "string",
7+
"required": true
8+
}
9+
}
10+
},
11+
"outputs": {
12+
"type": "object",
13+
"properties": {
14+
"riskFactor": {
15+
"type": "integer",
16+
"required": true
17+
},
18+
"reviewerComments": {
19+
"type": "string"
20+
}
21+
}
22+
},
23+
"inOuts": {
24+
"type": "object",
25+
"properties": {}
26+
},
27+
"outcomes": {
28+
"type": "object",
29+
"properties": {
30+
"Approve": {
31+
"type": "string"
32+
},
33+
"Reject": {
34+
"type": "string"
35+
}
36+
}
37+
}
38+
}

0 commit comments

Comments
 (0)