Use this thread to ask any questions related to the Integrate AEM Forms CS with Salesforce course on Experience League.
Experts are monitoring this thread to ensure your questions are answered.
@workflowuser Link is incorrect. Please check and correct it.
Views
Replies
Total Likes
Hello,
I am creating an adaptive form that will submit to Salesforce using the Integrate AEM Forms CS with Salesforce course on experience league. So far I have established the cloud services configuration and created the adaptive form from the form data model based on the Salesforce data source (Swagger file below; it's in json format but wouldn't let me choose that for the code snippet). I have been able to successfully submit a Lead to SF, but I am unable to include an attachment in the submission of the form. Please, help me determine what needs to be done to submit an adaptive form with an attached file to Salesforce lead. I am not sure of the swagger file, and what needs to be done while creating the form data model.
Thanks for any assistance/advice on this topic.
{
"swagger": "2.0",
"info": {
"description": "Sales Force Swagger Definition",
"version": "1.0.0",
"title": "Swagger Definition"
},
"schemes": [
"https"
],
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"host": "il--soiluat.sandbox.my.salesforce.com",
"paths": {
"/services/data/v32.0/query": {
"get": {
"summary": "Query Files for a Lead",
"operationId": "QueryFiles",
"parameters": [
{
"in": "query",
"name": "q",
"description": "SOQL query to fetch files for a lead. Example: SELECT Id, Title FROM ContentDocument WHERE LinkedEntityId = '<LeadId>'",
"type": "string"
}
],
"responses": {
"200": {
"description": "Files associated with the lead",
"schema": {
"$ref": "#/definitions/All"
}
}
}
}
},
"/services/data/v32.0/sobjects/Lead/{eMail}": {
"get": {
"summary": "Fetch Lead Information From SDFC",
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"operationId": "GetLead",
"parameters": [
{
"in": "path",
"name": "eMail",
"type": "string",
"description": "path to store data into",
"required": true
}
],
"responses": {
"200": {
"description": "Valid Lead output",
"schema": {
"$ref": "#/definitions/Lead"
}
},
"405": {
"description": "Invalid input"
}
}
}
},
"/services/data/v32.0/sobjects/Lead/{id}": {
"get": {
"summary": "Fetch Lead Information From SDFC",
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"operationId": "GetLead",
"parameters": [
{
"in": "path",
"name": "id",
"type": "string",
"description": "path to store data into",
"required": true
}
],
"responses": {
"200": {
"description": "Valid Lead output",
"schema": {
"$ref": "#/definitions/Lead"
}
},
"405": {
"description": "Invalid input"
}
}
}
},
"/services/data/v32.0/sobjects/Account/{id}": {
"get": {
"summary": "Fetch Account Information From SDFC",
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"operationId": "GetAccount",
"parameters": [
{
"in": "path",
"name": "id",
"type": "string",
"description": "path to store data into",
"required": true
}
],
"responses": {
"200": {
"description": "Valid Account output",
"schema": {
"$ref": "#/definitions/Account"
}
},
"405": {
"description": "Invalid input"
}
}
}
},
"/services/data/v32.0/sobjects/Account": {
"post": {
"summary": "Create Account Data",
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"operationId": "CreateAccount",
"parameters": [
{
"in": "body",
"name": "account",
"description": "account object that needs to be added",
"required": true,
"schema": {
"$ref": "#/definitions/Account"
}
}
],
"responses": {
"200": {
"description": "Valid output",
"schema": {
"$ref": "#/definitions/SFResult"
}
},
"405": {
"description": "Invalid input"
}
}
}
},
"/services/data/v32.0/sobjects/Lead": {
"post": {
"summary": "Create Lead Data",
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"operationId": "CreateLead",
"parameters": [
{
"in": "body",
"name": "lead",
"description": "lead object that needs to be added",
"required": true,
"schema": {
"$ref": "#/definitions/Lead"
}
}
],
"responses": {
"200": {
"description": "Valid output",
"schema": {
"$ref": "#/definitions/SFResult"
}
},
"405": {
"description": "Invalid input"
}
}
}
},
"/services/data/v32.0/sobjects/ContentVersion": {
"post": {
"summary": "Upload a File",
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"operationId": "UploadFile",
"parameters": [
{
"in": "body",
"name": "file",
"description": "File object that needs to be uploaded",
"required": true,
"schema": {
"$ref": "#/definitions/FileUpload"
}
}
],
"responses": {
"200": {
"description": "File successfully uploaded",
"schema": {
"$ref": "#/definitions/SFResult"
}
},
"405": {
"description": "Invalid input"
}
}
}
},
"/services/data/v32.0/sobjects/ContentDocumentLink": {
"post": {
"summary": "Link a File to a Lead",
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"operationId": "LinkFile",
"parameters": [
{
"in": "body",
"name": "link",
"description": "Object to link a file to a lead",
"required": true,
"schema": {
"$ref": "#/definitions/FileLink"
}
}
],
"responses": {
"200": {
"description": "File successfully linked to lead",
"schema": {
"$ref": "#/definitions/SFResult"
}
},
"405": {
"description": "Invalid input"
}
}
}
}
},
"definitions": {
"Lead": {
"type": "object",
"properties": {
"Phone": {
"type": "string"
},
"Company": {
"type": "string"
},
"LastName": {
"type": "string"
},
"FirstName": {
"type": "string"
},
"LeadSource": {
"type": "string"
},
"eMail": {
"type": "string"
}
},
"required": [
"Phone",
"Company",
"LastName",
"FirstName",
"eMail"
]
},
"Account": {
"type": "object",
"properties": {
"Phone": {
"type": "string"
},
"Name": {
"type": "string"
},
"Website": {
"type": "string"
},
"BillingCountry": {
"type": "string"
},
"BillingPostalCode": {
"type": "string"
}
},
"required": [
"Phone",
"Name",
"Website"
]
},
"SFResult": {
"type": "object",
"properties": {
"id": {
"type": "string"
}
},
"required": [
"id"
]
},
"All": {
"type": "object",
"properties": {
"totalSize": {
"type": "integer"
},
"records": {
"type": "array",
"items": {
"$ref": "#/definitions/Records"
}
}
}
},
"Records": {
"type": "object",
"properties": {
"attributes": {
"$ref": "#/definitions/Attributes"
}
}
},
"Attributes": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"FileUpload": {
"type": "object",
"properties": {
"Title": {
"type": "string"
},
"PathOnClient": {
"type": "string"
},
"VersionData": {
"type": "string",
"format": "base64",
"description": "Base64 encoded file content"
}
},
"required": [
"Title",
"PathOnClient",
"VersionData"
]
},
"FileLink": {
"type": "object",
"properties": {
"ContentDocumentId": {
"type": "string",
"description": "ID of the file (ContentDocument)"
},
"LinkedEntityId": {
"type": "string",
"description": "ID of the lead to link the file to"
}
},
"required": [
"ContentDocumentId",
"LinkedEntityId"
]
}
}
}
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies