One Star

[resolved] Null results when using Salesforce Input

Hi,
I've just recently started using Talend, and my first goal was to be able to export some data from Salesforce.com and into a SQL server database. I'm not having any trouble when trying to input an entire module. However, when I try to use SOQL to only select certain fields, I get all NULL results (for string fields...for integers I get 0). The row count of what I'm getting matches up with the row counts that are in the table. However no data shows up. This happens when inserting into SQL Server and outputting to a delimited flat file. Here's an example of a query that I'm using:
select ID,
Broker_Agent__c
FROM MLS_Approval_Request__c
I did some searching online and found that there is a registered bug where if the ID field isn't the first field selected then NULL results are returned. But as you can see that's not the case here. Anyone else know of anything that could be causing this? For now I can get around dumping the entire table and then querying from within SQL Server, but I'd prefer to just return the results that I'm using and do a single export using SOQL.
Thanks,
Joe
1 ACCEPTED SOLUTION

Accepted Solutions
Community Manager

Re: [resolved] Null results when using Salesforce Input

Hello Joe
Can you get the correct result with SOQL when you select other standard module like User? eg:
"select ID,Username, Lastname, firstname,Name from User"
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
10 REPLIES
Community Manager

Re: [resolved] Null results when using Salesforce Input

Hello Joe
Can you get the correct result with SOQL when you select other standard module like User? eg:
"select ID,Username, Lastname, firstname,Name from User"
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] Null results when using Salesforce Input

Hi Shong,
It works fine when I pull from a standard module. I ran the query that you provided me and everything came back as expected. Do you think it's a bug that custom modules won't allow you to use SOQL?
- Joe
Community Manager

Re: [resolved] Null results when using Salesforce Input

Hello Joe
If you are attempting to use a custom object, be sure to append the '__c' after the entity name. eg:
"select ID, name from myObj__c"
Note that here is double _
Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] Null results when using Salesforce Input

I am using the double underscore. If you refer back to my first post you'll see that I have it in both the field I'm selecting and the table I'm selecting from.
Community Manager

Re: [resolved] Null results when using Salesforce Input

Hello guy
I get the same problem, all the custom fields are null, can you report a bug on our bugtracker?
Thanks for your support!!!
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Community Manager

Re: [resolved] Null results when using Salesforce Input

Hello Jrugolo810
Just found that we should aslo add the '__c' on the column name on schema. Note that the filed name is case-sensitive.
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] Null results when using Salesforce Input

I've just recently started using Talend, As per my requirement I need to fetch the data of salesforce account object.
The query which I am using to fetch the account records ("Select Id from Account").
I have a table ("Customer") in sql server. I need to fetch records of Customer table and I want to use the Salesforce account Ids in the where clause of that query.
Can anyone tell me how can I do that.
Thanks,
Devendra
One Star

Re: [resolved] Null results when using Salesforce Input

Hi,
Did you ever find a solution to your problem? I'm sitting with exactly the same problem, but with the little twist that if if go with the string:
"SELECT Id, Unit_Price__c FROM Equipment_Data__c"
I get a correct value of the Unit_Price__c field.
But if I use the string:
"SELECT Id, Unit_Price__c, CreatedById, CreatedDate, Deal_Type__c, IsDeleted, Install_Date__c, Install_Sell_Out_Date__c, LastModifiedById, LastModifiedDate, Opportunity__c, Order_Date__c, Install_Outlook__c, Outlook_Install_Date__c, Product__c, Quantity__c, Total_Price__c, Transaction_type__c FROM Equipment_Data__c"
The field Unit_Price__c return a zero value.... (null).
What can be the problem?
Thanks.
Best regards,
Nicolai
One Star

Re: [resolved] Null results when using Salesforce Input

Hi,
has anyone had any luck with finding what is causing this problem? Or perhaps someone found a workaround? npaustian's workaround isn't working for me.
Thanks,
Ivan
One Star

Re: [resolved] Null results when using Salesforce Input

Hi,

It seems that's this problem isn't resolved at all. I have it too...

The query is like this : "Select Id, CustomField__c FROM Account Where CustomField__c !=null"

 

The number of lines is correct, the query works perfectly with the application Force.com but with Talend, the field CustomField__c is always Null.

 

I've found on https://help.talend.com/reader/_YDfvfhmdBzbX9dWMenklg/Lv~Pqm4u2XWOeTfUjL1xMA that there are tSalesforceInput Limitations when "the field with the underscore character '_' in its name"

But what can I do have the values, then ?