From 018b412fa838f2ef5160d8647ead3b08f20e82cb Mon Sep 17 00:00:00 2001 From: Tanumay92 <30310134+Tanumay92@users.noreply.github.com> Date: Wed, 1 Feb 2023 06:36:25 +0000 Subject: [PATCH 1/3] Upload employee data into Smartsheet Upload employee data into Smartsheet when new employee is created in Freshteam --- ... new employee is created in Freshteam.yaml | 254 ++++++++++++++++++ 1 file changed, 254 insertions(+) create mode 100644 resources/Upload employee data into Smartsheet when new employee is created in Freshteam.yaml diff --git a/resources/Upload employee data into Smartsheet when new employee is created in Freshteam.yaml b/resources/Upload employee data into Smartsheet when new employee is created in Freshteam.yaml new file mode 100644 index 000000000..cbc89bfbf --- /dev/null +++ b/resources/Upload employee data into Smartsheet when new employee is created in Freshteam.yaml @@ -0,0 +1,254 @@ +$integration: http://ibm.com/appconnect/integration/v2/integrationFile +integration: + type: api + trigger-interfaces: + trigger-interface-1: + triggers: + createTest: + assembly: + $ref: '#/integration/assemblies/assembly-2' + input-context: + data: Test + output-context: + data: Test + options: + resources: + - business-object: Test + model: + $ref: '#/models/Test' + triggers: + create: createTest + type: api-trigger + action-interfaces: + action-interface-1: + type: api-action + business-object: employees + connector-type: freshteam + actions: + CREATE: {} + action-interface-2: + type: api-action + business-object: employees + connector-type: freshteam + actions: + RETRIEVEALL: {} + action-interface-3: + type: api-action + business-object: row + connector-type: smartsheet + actions: + CREATE: {} + action-interface-4: + type: api-action + business-object: search + connector-type: smartsheet + actions: + RETRIEVEALL: {} + assemblies: + assembly-2: + assembly: + execute: + - create-action: + name: Freshteam Create employee + target: + $ref: '#/integration/action-interfaces/action-interface-1' + map: + mappings: + - first_name: + template: '{{$Request.first_name}}' + - last_name: + template: '{{$Request.last_name}}' + - official_email: + template: '{{$Request.official_email}}' + - role_ids: + expression: '$Request.role_ids ' + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Request + $ref: '#/trigger/payload' + - variable: flowDetails + $ref: '#/flowDetails' + - retrieve-action: + name: Freshteam Retrieve employees + target: + $ref: '#/integration/action-interfaces/action-interface-2' + filter: + where: + id: '{{$FreshteamCreateemployee.id}}' + input: + - variable: Request + $ref: '#/trigger/payload' + - variable: FreshteamCreateemployee + $ref: '#/node-output/Freshteam Create employee/response/payload' + - variable: flowDetails + $ref: '#/flowDetails' + limit: 10 + allow-truncation: true + pagination-type: TOKEN + allow-empty-output: false + - create-action: + name: Smartsheet Create row + target: + $ref: '#/integration/action-interfaces/action-interface-3' + map: + mappings: + - '2556783815878532': + template: '{{$FreshteamRetrieveemployees.official_email}}' + - '304984002193284': + template: '{{$FreshteamRetrieveemployees.first_name}}' + - '4808583629563780': + template: '{{$FreshteamRetrieveemployees.last_name}}' + - '8467758326802308': + template: '{{$FreshteamCreateemployee.id}}' + - sheetsid: + template: '7397199765104516' + - toTop: + expression: 'true' + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Request + $ref: '#/trigger/payload' + - variable: FreshteamCreateemployee + $ref: '#/node-output/Freshteam Create employee/response/payload' + - variable: FreshteamRetrieveemployees + $ref: >- + #/node-output/Freshteam Retrieve + employees/response/payload + - variable: FreshteamRetrieveemployeesMetadata + $ref: '#/node-output/Freshteam Retrieve employees/response' + - variable: flowDetails + $ref: '#/flowDetails' + - retrieve-action: + name: Smartsheet Search all + target: + $ref: '#/integration/action-interfaces/action-interface-4' + filter: + where: + and: + - query: '{{$Request.query}}' + - id: '{{$Request.sheetId}}' + input: + - variable: Request + $ref: '#/trigger/payload' + - variable: FreshteamCreateemployee + $ref: '#/node-output/Freshteam Create employee/response/payload' + - variable: FreshteamRetrieveemployees + $ref: >- + #/node-output/Freshteam Retrieve + employees/response/payload + - variable: FreshteamRetrieveemployeesMetadata + $ref: '#/node-output/Freshteam Retrieve employees/response' + - variable: SmartsheetCreaterow + $ref: '#/node-output/Smartsheet Create row/response/payload' + - variable: flowDetails + $ref: '#/flowDetails' + limit: 10 + allow-truncation: false + allow-empty-output: false + - response: + name: response-1 + reply-maps: + - title: Test successfully created + status-code: 201 + map: + mappings: + - first_name: + template: '{{$FreshteamRetrieveemployees.first_name}}' + - id: + expression: $FreshteamCreateemployee.id + - last_name: + template: '{{$FreshteamRetrieveemployees.last_name}}' + - official_email: + template: '{{$FreshteamRetrieveemployees.official_email}}' + - role_ids: + expression: $FreshteamRetrieveemployees.role_ids + - sheetsid: + template: '{{$SmartsheetRetrieverows.sheetsid}}' + - totalCount: + expression: '$SmartsheetSearchall.totalCount ' + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Request + $ref: '#/trigger/payload' + - variable: FreshteamCreateemployee + $ref: >- + #/node-output/Freshteam Create + employee/response/payload + - variable: FreshteamRetrieveemployees + $ref: >- + #/node-output/Freshteam Retrieve + employees/response/payload + - variable: FreshteamRetrieveemployeesMetadata + $ref: '#/node-output/Freshteam Retrieve employees/response' + - variable: SmartsheetCreaterow + $ref: '#/node-output/Smartsheet Create row/response/payload' + - variable: SmartsheetSearchall + $ref: '#/node-output/Smartsheet Search all/response/payload' + - variable: SmartsheetSearchallMetadata + $ref: '#/node-output/Smartsheet Search all/response' + - variable: flowDetails + $ref: '#/flowDetails' + input: [] + catch: + - default: + - response: + name: response-1 + reply-maps: + - title: Bad request + status-code: 400 + map: + mappings: + - message: + template: '{{$errorDetails.message}}' + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Request + $ref: '#/trigger/payload' + - variable: errorDetails + $ref: '#/error' + - variable: flowDetails + $ref: '#/flowDetails' + input: [] + name: Smartsheet External UseCase +models: + Test: + name: Test + properties: + id: + required: false + id: true + type: number + first_name: + required: false + id: false + type: string + last_name: + required: false + id: false + type: string + official_email: + required: false + id: false + type: string + role_ids: + required: false + id: false + type: + - number + sheetId: + required: false + id: false + type: string + totalCount: + required: false + id: false + type: number + query: + required: false + id: false + type: string + plural: Test + description: ' ' + operations: + create: '#/integration/assemblies/assembly-2' + methods: {} From 4f34a64363e11397972439729efaee89838f99e2 Mon Sep 17 00:00:00 2001 From: Tanumay92 <30310134+Tanumay92@users.noreply.github.com> Date: Wed, 1 Feb 2023 06:40:53 +0000 Subject: [PATCH 2/3] Update template metadata file for smartsheet Upload employee data into Smartsheet when new employee is created in Freshteam --- resources/template-metadata.json | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/resources/template-metadata.json b/resources/template-metadata.json index a41d4db87..fe9ef50de 100644 --- a/resources/template-metadata.json +++ b/resources/template-metadata.json @@ -1159,6 +1159,15 @@ "targetApps": ["jenkins", "slack"], "tags": ["github", "jenkins", "slack"], "offerings": ["app connect professional"] - } + }, + { +   "name": "create employees in Freshteam and insert employee data into Smartsheet", +   "description": "This template creates an employees in Freshteam and then insert data into Smartsheet.", +   "summary": "Freshteam to Smartsheet", +   "sourceApp": "Freshteam", +   "targetApps": ["Smartsheet"], +   "tags": ["Freshteam", "Smartsheet"], +   "offerings": ["app connect professional"] + } ] } From d470e740a6509b9cd5b66e3f1db3d1a54648404b Mon Sep 17 00:00:00 2001 From: Tanumay92 <30310134+Tanumay92@users.noreply.github.com> Date: Wed, 1 Feb 2023 06:44:41 +0000 Subject: [PATCH 3/3] Upload employee data into Smartsheet Upload employee data into Smartsheet when new employee is created in Freshteam_instructions --- ...ew employee is created in Freshteam_instructions.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 resources/markdown/Upload employee data into Smartsheet when new employee is created in Freshteam_instructions.md diff --git a/resources/markdown/Upload employee data into Smartsheet when new employee is created in Freshteam_instructions.md b/resources/markdown/Upload employee data into Smartsheet when new employee is created in Freshteam_instructions.md new file mode 100644 index 000000000..687f2a84a --- /dev/null +++ b/resources/markdown/Upload employee data into Smartsheet when new employee is created in Freshteam_instructions.md @@ -0,0 +1,10 @@ +To refer to these instructions while editing the flow, open [the github page](https://github.com/ot4i/app-connect-templates/blob/master/resources/markdown/Upload%20employee%20data%20into%20Smartsheet%20when%20new%20employee%20is%20created%20in%20Freshteam_instructions.md) (opens in a new window). + + +1. Click **Create flow** to start using the template. +2. Connect to the following accounts by using your credentials: + - **Smartsheet** + - **Freshteam** +3. To start the flow, in the banner, open the options menu [⋮] and click **Start flow**. + +The flow is started whenever a employee created in freshteam it will sync the data in smartsheet rows.