-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #92 from manu2699/board-csv
added import csv in board
- Loading branch information
Showing
6 changed files
with
164 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
--- | ||
title: Board | ||
description: Usage of board methods | ||
--- | ||
With Kissflow Boards, you can create highly adaptable workflows that let you keep track of information and manage work efficiently. | ||
|
||
Get board instance using `getBoard` method from app's interface. | ||
|
||
##### Parameters | ||
|
||
| Parameters | type | | ||
| ---------- | ------ | | ||
| caseId | String | | ||
|
||
##### Syntax | ||
|
||
```js | ||
const boardInstance = kf.app.getBoard("case_id"); | ||
``` | ||
|
||
### Import CSV | ||
|
||
Launches the import CSV modal, where you can upload a CSV file and map its | ||
columns to the corresponding fields. | ||
|
||
##### Parameters | ||
|
||
| Parameters | type | Description | | ||
| ------------- | ------ | -------------------------------------------------------------------- | | ||
| defaultValues | Object | Object with keys as field Id and its values in respective data types | | ||
|
||
##### Syntax | ||
|
||
```js | ||
let defaultValues = { fieldId: "value" }; | ||
boardInstance.importCSV(defaultValues); | ||
``` | ||
|
||
###### Example scenario | ||
|
||
Consider a scenario where certain fields are not visible to the user (hidden in | ||
form visibility). In that case, default values can be used to populate data in | ||
these hidden fields. | ||
|
||
```js | ||
// Get the board with the board's flow_id | ||
const boardInstance = kf.app.getBoard("Asset_Tracking_A00"); // Asset_Tracking_A00 is the flow_id | ||
|
||
// Set field values for specific fields of the board | ||
let boardInstance = { location: "India" }; // Location is the the field_id of a field inside the board | ||
|
||
// Pass the field config into the import sdk method | ||
boardInstance.importCSV(defaultValues); // All records imported through this importer would have Location field set as India | ||
``` | ||
|
||
> Note: | ||
> | ||
> 1. Default values are optional | ||
> 2. Any variables or parameter can also be mapped in `defaultValues`. | ||
> 3. If a default value is set by the developer, end users cannot override it. | ||
> 4. Certain fields cannot be set as default, such as auto-calculated fields and | ||
> sequence numbers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { BaseSDK, LISTENER_CMDS } from "../core"; | ||
|
||
export class Board extends BaseSDK { | ||
private _id: string; | ||
|
||
constructor(flowId: string) { | ||
super(); | ||
this._id = flowId; | ||
} | ||
|
||
importCSV(defaultValues: object) { | ||
return this._postMessageAsync(LISTENER_CMDS.BOARD_IMPORT_CSV, { | ||
flowId: this._id, | ||
defaultValues | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters