cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Salesforce - Output field limit

del
Contributor III

We have a use case to pull all fields from wide objects in Salesforce. I keep running into โ€œfield limitโ€ errors: image.
Does anyone have any logic or best practice for pulling in all fields from wide Salesforce objects?

1 ACCEPTED SOLUTION

sriram
Former Employee

Are you using the โ€œSalesforce Readโ€ and/or โ€œSalesforce SOQLโ€ snap to query wide objects in Salesforce? If yes, internally the read operation would be translated to a SOQL query equivalent for which there is a character count limitation from Salesforce (currently it is 20000 characters) and is documented here:

Reference:

If there is a need to query a wide Salesforce object which in turn causes the SOQL query translation/equivalent to exceed the query character count threshold, it would be best to leverage the โ€œOutput field limitโ€ and โ€œOutput field offsetโ€ properties available on the โ€œSalesforce Readโ€ snap.

Reference:
https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1439267/Salesforce+Read

For example:
Modify a pipeline using a single โ€œSalesforce Readโ€ snap querying a wide object into โ€˜Nโ€™ number of โ€œSalesforce Readโ€ snaps and specify the required limit/offset by ensuring that the equivalent SOQL query will be within the maximum allowed character limit. Document streams from the above branches can then be Unionโ€™d and/or Joined for downstream processing.

View solution in original post

3 REPLIES 3

sriram
Former Employee

Are you using the โ€œSalesforce Readโ€ and/or โ€œSalesforce SOQLโ€ snap to query wide objects in Salesforce? If yes, internally the read operation would be translated to a SOQL query equivalent for which there is a character count limitation from Salesforce (currently it is 20000 characters) and is documented here:

Reference:

If there is a need to query a wide Salesforce object which in turn causes the SOQL query translation/equivalent to exceed the query character count threshold, it would be best to leverage the โ€œOutput field limitโ€ and โ€œOutput field offsetโ€ properties available on the โ€œSalesforce Readโ€ snap.

Reference:
https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1439267/Salesforce+Read

For example:
Modify a pipeline using a single โ€œSalesforce Readโ€ snap querying a wide object into โ€˜Nโ€™ number of โ€œSalesforce Readโ€ snaps and specify the required limit/offset by ensuring that the equivalent SOQL query will be within the maximum allowed character limit. Document streams from the above branches can then be Unionโ€™d and/or Joined for downstream processing.

del
Contributor III

Thank you @sriram, thatโ€™s very helpful. I would want to capture all this recursively via a pipeline, but I donโ€™t necessarily know how many columns on any given object I have to tackle. As a bonus question ๐Ÿ™‚, do you know of a way to determine the column count from a Salesforce object? (My Google searches keep leading me to APEX code)

sriram
Former Employee

Looks like Salesforce does not expose a SOQL query-like capability to determine field count for an object, besides letting users do it in programmatic way that you have come across already. To handle this limitation / situation where in we are unable to determine the number of fields non-programatically, it would best to break the pipeline to include multiple โ€œSalesforce Readโ€ snaps (with Output field / Output field offset specified) to ensure that the query is well within the 20,000 character count threshold.