Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
I have a scenario where tSalesforceInput component query is expecting a value based on a variable which is part of the query. However, if it doesn't get a value through this variable, the component fails throwing a null pointer exception and job doesn't continue. We would like to have the job continue with next record.
tFileinput -> tmap -> tFlowiterate ->tSalesforceInput
Thanks
J
Hi Jennifer_siders,
As per your job, you would be getting nulls from tmap if you are getting f4.AccountId global variable from tmap. if you don't need them you can filter in tmap itself or you should filtering nulls from your global variable for : globalMap.get("f4.AccountId" ).toString() !=null
Let me know if it helps.
Hello,
Could you please post your job design screenshot here? Which will be helpful for us to address your issue.
Best regards
Sabrina
Hi Jennifer_siders ,
Could you try with a if-else condition for the column which you are getting null pointer exception, like this: if (column1!=null?column1:null) modify as per you requirement, if it doesn't work please post your job design
Hi @Xiaodi Shi @Vikram Kumar Thank you for the response.
The job flow is
tSalesforceinput component has a query which uses a variable from f4
The query inside the tSalesforceInput is :
select id, Name from Customer__c where Account__c = '"+globalMap.get("f4.AccountId" ).toString() , and as f4.AccountId is null, there is a null pointer exception once the tSalesforceinput executes.
Thank you very much.
Hi @Vikram Kumar
if (column1!=null?column1:null) if use this, are we not again sending null whenever column1 is null? and when the value is null, the system is throwing null pointer exception.
Hi Jennifer_siders,
As per your job, you would be getting nulls from tmap if you are getting f4.AccountId global variable from tmap. if you don't need them you can filter in tmap itself or you should filtering nulls from your global variable for : globalMap.get("f4.AccountId" ).toString() !=null
Let me know if it helps.
Hi @Vikram Kumar
Thank you for taking time. I think i am close to fix this. I am very new to Talend designing..so..
So in my job if tMap1->AccountId == null, then i dont want to continue to tMap3 and thus go to next record coming from tFileinputDelimited.
As you suggested to filter it in tMap1 or tMape_3, how do we actually do it? Could you advise?
Thanks
J
Hey i believe i have fixed it by using
in my tmap filter ! Relational.ISNULL(row2.Account__c)
Glad to hear that you were able to fix. Thanks