Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Jennifer_siders
Contributor III
Contributor III

OnComponent Error

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

Labels (3)
1 Solution

Accepted Solutions
vikramk
Creator II
Creator II

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.

 

 

 

 

View solution in original post

8 Replies
Anonymous
Not applicable

Hello,

Could you please post your job design screenshot here? Which will be helpful for us to address your issue.

Best regards

Sabrina

vikramk
Creator II
Creator II

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

Jennifer_siders
Contributor III
Contributor III
Author

Hi @Xiaodi Shi​  @Vikram Kumar​  Thank you for the response.

 

The job flow is

 

0693p000009ocfZAAQ.jpg

 

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.

Jennifer_siders
Contributor III
Contributor III
Author

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.

vikramk
Creator II
Creator II

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.

 

 

 

 

Jennifer_siders
Contributor III
Contributor III
Author

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

Jennifer_siders
Contributor III
Contributor III
Author

Hey i believe i have fixed it by using

 

in my tmap filter ! Relational.ISNULL(row2.Account__c)

vikramk
Creator II
Creator II

Glad to hear that you were able to fix. Thanks