Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

On In this Pagearticle

Table of Contents
maxLevel2
excludeOlder Versions|Additional Resources|Related Links|Related Information

Overview

Salesforce Wave Analytics Snap

type:

Write

Description:

This

is a Write-type Snap that enables you to load external data into Salesforce Wave Analytics. This Snap converts a stream of input documents into CSV data and meta data and uploads them to Salesforce Wave Analytics as an external data. It scans the first 50 documents and generates the meta data automatically, which can be overridden by users. The Snap uploads CSV data in multi parts with each not exceeding 10MB.

  • Expected upstream Snaps:  Any Snap with a document output view
  • Expected downstream Snaps:  Any

    Image Added

    Prerequisites

    None.

    Support for Ultra Pipelines

    Works in Ultra Task Pipelines.

    Limitations and Known Issues

    None.

    Snap Views

    View TypeView FormatNumber of ViewsExamples of Upstream and Downstream SnapsDescription
    InputDocument
    Min: 1
    Max: 1
    Any Snap with a document
    input
    output view
    Expected
    Each input
    :  Each input
    document should have a flat map data since it will be converted to one row of CSV data. If this map data contains a value of another map or list object, the document is not used and
    passed to the error view.Expected output:  If
    passed to the error view.
    OutputDocument
    Min: 0
    Max: 1
     Any Snap with a document input viewIf the Snap is in the Preview Action mode, it writes the
    meta data to the output view.Prerequisites:

    None

    Support and limitations:Works in Ultra Task Pipelines.Account: 

    This Snap uses account references created on the Accounts page of SnapLogic Manager to handle access to this endpoint. See Configuring Salesforce Accounts for information on setting up this type of account.

    Views:Input
    meta data to the output view.
    ErrorDocumentThis Snap has
    exactly
    one optional document
    input
    error view.
    Output

    This Snap has at most one document output view.

    Error

    This Snap has one optional document error view.

    Settings

    Label

    Required.
    N/AThe error view contains error, reason, resolution and stack trace. For more information, see Handling Errors with an Error Pipeline

    Snap Settings

    Field Field TypeDescription

    Label*


    StringThe name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your
    pipeline
    Pipeline.

    Service

    version

    Version*


    String/Expression/Suggestion

    Multiexcerpt include macro
    nameME_Service_Version
    pageSalesforce Batch Create

    Edit metadata


    Button
    Required.

    This option lets you edit metadata for the CSV data to be uploaded to Salesforce Analytics.  Please refer to the example below for more information.

    Dataset

    aliasRequired.

    Alias*

    String/Expression

    Alias of an

    Dataset

    dataset, which must be unique across an organization.

    Default Value: [None]

    Operation*

    Dropdown list
    Required.

    Indicates which database operation to use when loading data into the Dataset. The options available include:

    • OVERWRITE - Create a new Dataset with the given data, and replace Dataset if it already exists.
    • APPEND - Add all data to the Dataset. Reserved for future use.
    • UPSERT - Insert or update rows in the EdgeMart. Reserved for future use.
    • DELETE - Delete the rows from the EdgeMart. Reserved for future use.

    Default Value: Overwrite

    Action*

    Required.


    Dropdown list

    Action to perform on the external data. 'Upload' means 'upload external data from SnapLogic to Salesforce.com', and 'Process' means 'load uploaded data into Dataset'. The options available include:

    • UPLOAD_AND_PROCESS - Upload external data from SnapLogic to Salesforce.com and load uploaded data into Dataset.
    • UPLOAD - Upload external data from SnapLogic to Salesforce.com and do not load uploaded data into Dataset yet.
    • PROCESS - Load uploaded data into Dataset.
    • ABORT - Stop processing the data if possible. Reserved for future use.
    • DELETE - Remove uploaded data parts as soon as possible. Reserved for future use.
    • PREVIEW - processes input documents, generates and writes CSV metadata to the output view without uploading the external data to Dataset.

    Default Value: UPLOAD_AND_PROCESS

    Id

    ID
     

    String/Expression

    The unique ID of the loaded external data. This property is required if the action is 'Process'.

    Default Value: [None]

    Dataset

    container

    Container


    String/Expression

    The folder name. If not specified when creating a new Dataset, the Dataset container will be the user’s private folder. If not specified for an existing Dataset, the Dataset container will be the folder that currently contains the Dataset. If Dataset container is specified for an existing Dataset, it must match the current folder that contains the Dataset.

    Default Value: [None]

    Poll

    process status

    Process Status

    Checkbox

    If selected, the Snap polls until the process status becomes 'Completed' or 'Failed'. If unselected, the Polling interval and the Polling timeout properties are ignored.

    Default Value: Not selected

    Polling

    interval

    Interval*


    String

    Required. This setting enables you to define the polling interval in seconds for the Bulk API batch job execution. At each polling interval, the Snap checks the status of the Bulk API batch processing.

    Default Value: 10
    Example: 5

    Maximum Value: 60

    Polling

    timeout

    Timeout*

    String

    Required. This setting enables you to define the polling timeout in seconds for the Bulk API batch job execution. If the timeout occurs while waiting for the completion of the batch job execution, the Snap throws a SnapExecutionException.

    Default Value600
    Example: 300
    Maximum Value: 1800

    Multiexcerpt include macroname

    Snap Execution

    pageSOAP Execute
    Dropdown list

    Multiexcerpt include macro
    nameExecution_Detail_Write
    pageSOAP Execute

    Insert excerpt
    Salesforce Batch Create
    Salesforce Batch Create
    nopaneltrue

    Note

    When you upsert records, you may make a record related to another record in the parent object by providing an additional key/value entry in the input document. You may use the suggest buttons in the Related object and the Related external ID properties for an available selection for the object type of the records to be upserted. If values are entered in these properties, you may connect the Mapper Snap in front of the Create Snap to see the input schema suggest, which helps see how input data should be prepared to establish a relationship between records. Additionally, if you want to get the resulting status for each record to be upserted in Bulk API mode, you must connect a Salesforce Poller Snap after the Salesforce Upsert Snap.


    For an example of "Contact" as Object type, "Account" as Related object and "AccountNumber__c" as Related external ID, the following additional key/value entry should be added to the input document:

    Code Block
    {
                        "Account" :  {
                                "AccountNumber__c" :  "3520842673"
                        }
                }


    Example


    The following example Pipeline shows how to upload data to Salesforce Wave Analytics.

    In this Pipeline execution:

    Object record details are provided to Salseforce Wave Analytics Snap as a CSV using a CSV Generator Snap: 


    A Salesforce Wave Analytics Snap uploads and processes the incoming records:  

    Successful execution of the Snap gives the following preview:

    The following is an example for the Edit metadata property. Note that, by default, the metadata is populated for the incoming data in the Salesforce Wave Analytics Snap. You can customize the metadata further based on your requirements:

    Code Block
    {
        "fileFormat": {
            "charsetName": "UTF-8",
            "fieldsEnclosedBy": "\"",
            "fieldsDelimitedBy": ",",
            "linesTerminatedBy": "\n",
            "numberOfLinesToIgnore": 1
        },
        "objects": [
            {
                "rowLevelSecurityFilter": "",
                "connector": "SnapLogic",
                "description": "",
                "fullyQualifiedName": "SalesData",
                "label": "Sales Data",
                "name": "SalesData",
                "fields": [
                    {
                        "description": "",
                        "fullyQualifiedName": "SalesData.Name",
                        "label": "Account Name",
                        "name": "Name",
                        "isSystemField": false,
                        "defaultValue": "",
                        "isUniqueId": false,
                        "isMultiValue": false,
                        "type": "Text",
                        "precision": 0,
                        "scale": 0,
                        "format": ""
                    },
                    {
                        "description": "",
                        "fullyQualifiedName": "SalesData.Amount",
                        "label": "Opportunity Amount",
                        "name": "Amount",
                        "isSystemField": false,
                        "defaultValue": "",
                        "isUniqueId": false,
                        "isMultiValue": false,
                        "type": "Numeric",
                        "precision": 10,
                        "scale": 2,
                        "format": "$#,#\#0.00"
                    },
                    {
                        "description": "",
                        "fullyQualifiedName": "SalesData.CloseDate",
                        "label": "Opportunity Close Date",
                        "name": "CloseDate",
                        "isSystemField": false,
                        "defaultValue": "",
                        "isUniqueId": false,
                        "isMultiValue": false,
                        "type": "Date",
                        "precision": 0,
                        "scale": 0,
                        "format": "MM/DD/YYYY",
                        "fiscalMonthOffset": 0
                    }
                ]
            }
        ]
    }

      

    The list of map data at "fields" is initially empty, which is a place for CSV column metadata. If the Action property is set to "PREVIEW", the Snap will try to generate the CSV metadata automatically and writes it to the output view. You can copy and paste it into the Edit metadata property. If the list of map data at "fields" is not empty, the content of the Edit property will override what is generated automatically. Therefore, you can use the Edit metadata property to fine-tune the CSV column metadata.
     

    For "Date" type, use the Java date format string as defined in http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
    The Snap takes four types of joda data/time java objects (DateTime, LocalDateTime, LocalDate and LocalTime) and automatically converts them to strings with formats: "yyyy-MM-dd'T'HH:mm:ss.SSSZZ", "yyyy-MM-dd'T'HH:mm:ss.SSS", "yyyy-MM-dd", and "HH:mm:ss.SSS" correspondingly.


    The currency data type is not automatically detected by the Snap. You should make sure the input data is string and edit the "type", "precision", "scale" and "format" fields as in the example above. Please note "##" should be edited as "#\#" because the editor in the Edit metadata property uses "##" as a comment. If the second '#' is not escaped, the remaining string is not passed from the editor to the Snap, which will cause it fail to upload data.

    See Also


    Insert excerpt
    Salesforce Snap Pack
    Salesforce Snap Pack
    nopaneltrue