Public/New-SurveyResponses.ps1

<#
    .SYNOPSIS
    Creates an survey responses object.
 
    .DESCRIPTION
    Creates the survey portion of the JSON message in hashtable form to send to the eCC Salesforce API to accept measurements and surveys.
 
    .INPUTS
    None. You cannot pipe objects to New-SurveyResponses.
 
    .OUTPUTS
    None.
 
    .PARAMETER SurveyQuestionId
    An survey question identifier.
 
    .PARAMETER AnswerIds
    A string array of answer ids for the question id specified
#>

function New-SurveyResponses {
    param([String]$SurveyQuestionId, [String[]]$AnswerIds)
    $aids = $AnswerIds | ForEach-Object { @{"Survey_Answer__c" = $_ } }
    @{
        "Survey_Question__c" = $SurveyQuestionId
        "Answers" = $aids
    }
}