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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

"Unable to parse json request" error in validation service

Ru
14-Alexandrite
14-Alexandrite

"Unable to parse json request" error in validation service

hello,

getting an error "Unable To Parse JSON Request" while adding membership plan through mashup.

i have one code which gives me existing existing plan name in database and i my another code is validation service created for the mashup where i wanted to compare plan name present in database with the validation service input plan name.

Now when i click on add button it gives me an error "Unable To Parse JSON Request" i dont know why i am getting this error. below is my validation service code:-

// result: INFOTABLE dataShape: ""
let resultName = Things["PostgreSQL_DB"].getPlanName({
plan_name: plan_name /* STRING */
});
// result: BOOLEAN
let Priceresult = me.validateInteger({
number: Price /* STRING */
});

if(plan_name == "" || plan_name == null){
result = 'Please enter Plan Name';
}
else if(resultName.plan_name == plan_name){
result = 'Plan is already exist';
}
//else if(resultName.count > 0)
//{
// result = 'membership plan name is already exist';
//}
else if(Price == "" || Price == null){
result = 'Please enter Price';
}
else if(Priceresult == false){
result = 'Please enter price in number';
}

else if(plan_type_id == "" || plan_type_id == null){
result = 'Please select plan type';
}
else if(plan_type_id == 1){
result= '';
}
else if(plan_type_id == 2){
if(MembershipLength == "" || MembershipLength == null){
result = 'Please enter number of days';
}
else if(frequency_unit == "" || frequency_unit == null){
result = 'Please select membership length';
}
else{
result= '';
}
}


else if(plan_type_id == 3){

if(FromDate == "" || FromDate == null){
result = 'Please select From date';
}
else if(ToDate == "" || ToDate == null){
result = 'Please select To date';
}
else{
result= '';
}
}

2 REPLIES 2
slangley
23-Emerald II
(To:Ru)

Hi @Ru.

 

Is it happening all the time?  Have you checked the logs located in ThingworxStorage\logs for any clues? You may also want to enable stacktrace.  To do so, browse to the LoggingSubsystem and go to the Configuration tab.

 

Regards.

 

--Sharon

slangley
23-Emerald II
(To:slangley)

Hi @Ru.

 

If the previous response helped you to find the cause of the issue, please mark it as the Accepted Solution for the benefit of others with the same issue.

 

Regards.

 

--Sharon

Announcements


Top Tags