From 4675b580f4e9f262d35d8172a6f4142f5f887bd2 Mon Sep 17 00:00:00 2001 From: prakashed <81418561+prakashed@users.noreply.github.com> Date: Tue, 24 Jan 2023 08:45:15 +0000 Subject: [PATCH 1/3] Insert employee data into Smartsheet Insert employee data into Smartsheet when new employee is created in Fresh team --- ... new employee is created in Freshteam.yaml | 254 ++++++++++++++++++ 1 file changed, 254 insertions(+) create mode 100644 resources/Insert employee data into Smartsheet when new employee is created in Freshteam.yaml diff --git a/resources/Insert employee data into Smartsheet when new employee is created in Freshteam.yaml b/resources/Insert employee data into Smartsheet when new employee is created in Freshteam.yaml new file mode 100644 index 000000000..356d09daa --- /dev/null +++ b/resources/Insert 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: + - '2041256945182596': + template: '{{$FreshteamCreateemployee.id}}' + - '4293056758867844': + template: '{{$FreshteamRetrieveemployees.last_name}}' + - '6544856572553092': + template: '{{$FreshteamRetrieveemployees.first_name}}' + - '8796656386238340': + template: '{{$FreshteamRetrieveemployees.official_email}}' + - sheetsid: + template: '5786262205425540' + - 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 fcb657d89e6c988c31110dc2a633e8d6af2d321e Mon Sep 17 00:00:00 2001 From: prakashed <81418561+prakashed@users.noreply.github.com> Date: Tue, 24 Jan 2023 09:07:46 +0000 Subject: [PATCH 2/3] Update template-metadata for Freshteam Update template-metadata for 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..48691bad4 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 sync employees data to Smartsheet", + "description": "This template creates an employees in Freshteam and then sync data to Smartsheet.", + "summary": "Freshteam to Smartsheet", + "sourceApp": "Freshteam", + "targetApps": ["Smartsheet"], + "tags": ["Freshteam", "Smartsheet"], + "offerings": ["app connect professional"] + } ] } From 45172c3f89a090e862e9cfa4e9df028fd8ab7c7e Mon Sep 17 00:00:00 2001 From: prakashed <81418561+prakashed@users.noreply.github.com> Date: Tue, 24 Jan 2023 09:23:29 +0000 Subject: [PATCH 3/3] Instruction file for Freshteam --- ...ew employee is created in Freshteam_instructions.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 resources/markdown/Insert employee data into Smartsheet when new employee is created in Freshteam_instructions.md diff --git a/resources/markdown/Insert employee data into Smartsheet when new employee is created in Freshteam_instructions.md b/resources/markdown/Insert employee data into Smartsheet when new employee is created in Freshteam_instructions.md new file mode 100644 index 000000000..79723653c --- /dev/null +++ b/resources/markdown/Insert 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/Insert%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: + - **Freshteam** + - **Smartsheet** +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 employees it will sync the data in smartsheet rows