cancel
Showing results for 
Search instead for 
Did you mean: 

data source query

SOLVED
Contributor

data source query

Hi Team,

 

I have a scnerio where I need to fetch request data from data source and sink the response data in source file.my data is as below.so for below 4 fields we have differenct scnerios in a excel sheet and i tried to feetch excel sheet data into request like-${DataSource#LifeCycle},${DataSource#LifeStage},${DataSource#Loyalty_ID},${DataSource#PLCC_ID} in request.

below are the fields:-

LifeCycle:1

LifeStage:2

LoyaltyIndicator:true

PLCCIndicator:false

when i send this request I got 1 error as-

"Error 500: javax.servlet.ServletException: org.codehaus.jackson.map.JsonMappingException: Can not construct instance of boolean from String value '': only "true" or "false" recognized
at [Source: com.ibm.ws.webcontainer.srt.http.HttpInputStream@8813ee4a&#59; line: 38, column: 10] ",observed that error is due to LoyaltyIndicator,PLCCIndicator fields.

 

so my question is how i fetch this 2 fields data with data source in my request,is it the right approch-${DataSource#Loyalty_ID},${DataSource#PLCC_ID} ?

1 ACCEPTED SOLUTION

Accepted Solutions
Super Contributor

Re: data source query

Hi Amarnath,

 

Could you please try below approach for the issue:-

  1. Format the excel cell and set as "Text". -> Right click on the cell->Format Cells->From Category->Select Text.
  2. And then in groovy code:- String localtyID = ${DataSource#Localty_ID}.

Hope, this can help you out. Let me know after you try this approach and send the screenshot of the error you get.

4 REPLIES 4
Highlighted
Community Manager

Re: data source query

@Lucian@msiadak, we need your knowledge here. What can you suggest?

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
Occasional Contributor

Re: data source query

Hi,

i don't know if this helps, but have you tried convertion boolean "true" and "false" to string?

 

boolean PLCCIndicator = true;
String str = String.valueOf(PLCCIndicator);

 

Then use the "str" as you wish.

 

Regards

-Konstantinos

Super Contributor

Re: data source query

Hi Amarnath,

 

Could you please try below approach for the issue:-

  1. Format the excel cell and set as "Text". -> Right click on the cell->Format Cells->From Category->Select Text.
  2. And then in groovy code:- String localtyID = ${DataSource#Localty_ID}.

Hope, this can help you out. Let me know after you try this approach and send the screenshot of the error you get.

Contributor

Re: data source query

this is working.

 

thanks.

New Here?
Join us and watch the welcome video:
Top Kudoed Authors