This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
Some Salesforce users do not use Salesforce Security Tokens. An accepted IP range can be set up instead in Salesforce Admin. This article will walk you through the steps to modify the Salesforce Output tool to be able to be used without a Salesforce Security Token.
If you observe an error message like Error: Salesforce Input (1) File " ", line 1 os.environ['PATH'] = r"... please read on to learn how to adjust the environment variables to resolve it. This can happen with any one of several Connector tools, not just the tool mentioned in the example.
When using the Salesforce Input tool, the following error is seen at run-time:
400: Bad Request
This may only occur on some tables
It fails almost immediately after the workflow starts running.
It may also been seen on the Salesforce Credentials screen along with the error:
invalid_grant: authentication failure
Salesforce Input tool
Version 4.0 or 4.1
Confirm where you are seeing the error. If it is on the Salesforce Credentials configuration page when you click Connect, and you see "invalid_grant", please see Solution B.
Otherwise, validate the query to get a more verbose error log.
1. Use the Query Builder option (this is the default option) and select the Table and Output Fields you want to read in.
2. Change to the Custom Query option and click the Validate button:
3. If you receive the error: "OPERATION_TOO_LARGE: exceeded 100000 distinct ids", see Solution A.
The data you are attempting to pull is too large to be returned in one call based on the Salesforce API limits used by the Salesforce Input Tool. Limit the number of results returned by modifying the WHERE Clause (SOQL) in the tool's configuration:
Please see the Additional Resources section below for a guide on SOQL (Salesforce Object Query Language). Here are some suggestions:
Try limiting date fields by relative dates :
CreatedDate = THIS_YEAR
Try limiting a string field to a certain value:
You can also combine conditions with logical operators like AND & OR:
Name='SFDC Computing' AND NumberOfEmployees>25
For more advanced comparisons, you can perform fuzzy matches by using the LIKE operator. For example, you can retrieve all accounts whose names start with SFDC by using this condition:
WHERE Name LIKE 'SFDC%'
- The % wildcard character matches any or no character. The _ character in contrast can be used to match just one character.
The credentials are incorrect. Please confirm your Username, Password, and Token are correct.
Salesforce Knowledge Base - Write SOQL Queries
Salesforce Knowledge Base - Reset Your Security Token
Salesforce Output tool used in a non-English Designer produces the following error:
Error - ToolId 1: ツール#93: Error trying to create the job. HTTP/1.1 400 Bad Request ... Data from server: <?xml version="1.0" encoding="UTF-8"?><error xmlns="http://www.force.com/2009/06/asyncapi/dataload"> <exceptionCode>InvalidJob</exceptionCode> <exceptionMessage>Unable to parse Job</exceptionMessage> </error>
Alteryx Designer - Non-English
Salesforce Output tool
The cause is due to passing in a non-English operation value to Salesforce as selected in the "Output Operation" option in the Salesforce Output tool.
An example of a non-English (Japanese) output operation options in Salesforce Output tool:
Value passed to Salesforce:
<?xml version="1.0" encoding="UTF-8"?>
To address this, please update the "Gui.html" file to use English operation values so the "Output Operation" options will display in English instead.
Close the Designer.
Backup "Gui.html" in "...\Alteryx\Tools\SalesforceOutput_v1.3.0\" or "...\Alteryx\Tools\SalesforceOutput_v1.3.1\".
Modify the "Gui.html" file
<alteryx-pluginwidget type="DropDown" id="dataItemOutputOptions" dataName="OutputOptions">
<alteryx-pluginwidget type="DropDown" id="dataItemOutputOptions" dataName="OutputOptions">
With the change, the "Output Operation" options will show "Update", "Insert" and "Delete" in English instead.
4. Open your workflow and re-select the output operation value in the Salesforce Output tool.
Issue - Unable to connect to Salesforce Output tool
When connecting to the Salesforce Output tool, the following error is observed and an empty red box appears:
Salesforce Output Tool
Salesforce Lightning URLs are not supported. Lightning URLs take the following format:
Use a non-lightning URL. This can be provided by your Salesforce administrator and as looks as follows: https://na7.salesforce.com/
The 'How to Guide' to the Salesforce Connector
Connecting to Salesforce
In order to use the Salesforce Input or Output tools in Alteryx, you must first connect to Salesforce using your Salesforce credentials:
1. Make sure you have the correct Salesforce URL; it will look something like https://[instance].salesforce.com .
2. Your Salesforce username
3. Your Salesforce password
4. A Security token that you can recover from your Salesforce administrator or using the steps below (if you have the sufficient privileges from your Salesforce admin):
In Salesforce.com, click on the picture icon in the top right-hand corner and click on my Settings:
Click on Personal > Reset My Security Token:
This will send out an automated email with your security token. Voila! You should be ready to connect!
Configuring the tool
Environment - Choose the environment that you wish to utilize for the data pull. We will automatically find the host name based on your email address.
User Name - Salesforce username (often an Email address).
Password - Password associated with Salesforce account.
Security Token - If necessary, you can send a new token to your email by logging in to Salesforce, going to “My Settings”, and selecting “Reset My Token” under the “Personal” tab.
Once you click the ‘connect’ button, Salesforce will authorize your credentials, and you will be able to begin using the tool to query Salesforce data.
Salesforce Input Tool (Querying Salesforce)
The Query Builder has four fields that allow you to select the data you would like to pull from Salesforce simply, without having to write full SOQL (Salesforce Object Query Language) statements:
Table: Select the table you would like to pull fields from. *The list only includes ‘Queryable’ tables as defined by the flag ‘Queryable’ set to true or false returned by the API call.
Fields (optional): Select the fields in the table you need data from. If no fields are selected, all fields will be pulled.
Record Limit (optional): Place a MAX on the number of records you will pull.
WHERE Clause (optional): Using a SOQL statement, specify the conditions that you require for the data you pull. *You do not need to include ‘WHERE’ in the statement. Ex. AccountID = ‘2543456’
It is best practice to limit the records you bring in with the Fields, Record Limit, and WHERE clause arguments in the Salesforce Tool instead of bringing in all of the salesforce data, and then filtering down the data with tools in Alteryx.
If you prefer Querying Salesforce using SOQL, you can use the Customer Query to write out SOQL statements. For full SOQL Syntax, see this link. If you began using the Query Builder, and decided to change to the custom query, the pre-existing query will already exist in the Query Builder in full SOQL syntax:
Below the SOQL Query text box is a check box for “Attempt to Parse JSON Response.” With this box checked (the box is checked by default), Alteryx will attempt to parse the response returned from the API call for quick viewing in the results window. If the box is left unchecked, the API response will be returned in one field titled “JSON.” You can parse this response using the JSON Parse tool in Alteryx.
Next to the “Attempt to Parse JSON Response” check box is a “Validate” button. Clicking this button prior to running the workflow will submit the query to Salesforce to determine if it valid. It will also check to see if the response from the API will be able to be parsed automatically, which should prompt you to leave the “Attempt to Parse JSON Response” check box selected.
This option will allow you to pull any pre-built reports and their data that already exist in Salesforce. Simply select the report you which to read in and run the workflow.
Salesforce Output Tool (Writing to Salesforce)
Connecting to the Salesforce Output is identical to the Salesforce input tool. URL, User Name, Password, and Security Token are all required credentials to connect to the API.
There are only two options that need to be selected in the Salesforce Output tool. Both are required.
Table: Select a table to write to from the list of tables available
Output Operation: Select the operation for how you will write the data to the table. The three available options are Update, Insert, and Delete.
** If you want to overwrite values in Salesforce with null values, use “#N/A” instead of “null.” You can accomplish this with a replace function in the Formula tool.
Basic Troubleshooting steps:
Error: “Unable to reach SOAP API (Check URL)”
-Check to see if your username needs to have the domain attached (eg. JonDoe@alteryx.com).
-If you’ve ensured that the URL is correct, this may be a proxy issue. Alteryx should pick up the proxy settings, but you may need to enable them manually by going to Options->User Settings->Edit User Settings->Advanced. There is an article on the community that walks through this.
-The tool requires that your Salesforce account is API enabled. You may have to work with your Salesforce administrator for granting your account API User Permissions.
Error: “The following fields are not updateable members of the target table: (table)”
This error is telling you that your Salesforce administrator has locked the fields from being updated, and you will have to work with them determine what can be updated.
Error: “INVALID_LOGIN: Invalid username, password, security token; or user locked out.”
After you have confirmed that your credentials are correct, and you are not locked out of Salesforce, check to see if your company uses SSO (single-sign-on) for Salesforce. You can check this by seeing if Salesforce requires a password directly when you log in a browser. This authentication is not supported by the connector, and will not work. You must use credentials that log you in directly into Salesforce for the tool to work.
*See the “Common Issues” section of this Community article by @JordanB for more common issues and troubleshooting steps.
Salesforce has a maximum length for SOQL statements, which is set at 20,000 characters by default. There is also a maximum length of 4,000 characters for the WHERE clause. Other SOAP API call limits can be found here.
As the API accepts data in batches which have limits, the output tool contains logic to take care of the batching. Please see this link for more details.
When using the Salesforce Input tool, you can limit the data to a certain timeframe. Alteryx has the ability to use SOQL date queries so that you pull data for a certain time frame instead of pulling ALL of your data and then having to filter out what you are interested in. Pulling all of your data can take some time depending on the size of your table and this is a quick way to get around a potentially slow data pull.
Once you have entered your Salesforce credentials, go ahead and pick your table (1). From the table you have selected choose your fields (2). At least one has to be some kind of field with dates and/or date times recorded. And finally, you can enter in a SOQL query that will execute on your date field (3).
The date query that you enter could be something as simple as a specific date, for example, ‘DateField = 2016-03-31’ or ‘DateField > 2016-03-31’. Or you could use some of the SOQL date literal query options. For example ‘DateField = YESTERDAY’ or ‘DateField = LAST_QUARTER’
Here is a full listing of your date query options when using SOQL to query on dates in the salesforce input tool - Date Formats and Date Literals. If you need help in getting your salesforce login credentials please see our Obtaining Credentials for the Salesforce Connectors article.
If you run into any issues with the Salesforce input tool, please feel free to reach out to our Client Support team through the Case Portal.