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

How to use "contains" function in router? I am getting error of expression failure

ruchi_pandey
New Contributor II

Hi guys,

I am trying to use router with diff data scenarios, where I have to give conditions like:
1)
($DIFF_REC_COUNT<0) && (_PIPELINE_NAME.contains(โ€˜DI_AVT_DH_PERSON_TYPE_ODSโ€™,โ€˜DI_AVT_DH_PERSON_CITIZENSHIP_ODSโ€™,โ€˜DI_AVT_DH_PERSON_LANGUAGE_ODSโ€™))

If its true, goto Success flow or

  1. ($DIFF_REC_COUNT<0) && (_PIPELINE_NAME.contains(โ€˜DI_AVT_DH_PERSON_TYPE_STGโ€™,โ€˜DI_AVT_DH_PERSON_CITIZENSHIP_STGโ€™,โ€˜DI_AVT_DH_PERSON_LANGUAGE_STGโ€™))

goto this flow.

But looks like this expression is not correct; hence I am getting error like:

Failure: Unexpected error occurred while evaluating expression: SC@7e0b949, Resolution: Please check your expression

Please suggest!

1 ACCEPTED SOLUTION

I solved this issue actuallyโ€ฆ
I gave this exp and it worked.

($DIFF_REC_COUNT<0) && (_PIPELINE_NAME.contains(โ€˜PERSON_TYPE_ODSโ€™)|| _PIPELINE_NAME.contains(โ€˜PERSON_CITIZENSHIP_ODSโ€™)|| _PIPELINE_NAME.contains(โ€˜PERSON_LANGUAGE_ODSโ€™) )

THanks for your quick response thoughโ€ฆ ๐Ÿ™‚

View solution in original post

11 REPLIES 11

anubhav_nautiya
Contributor

with your .contains function, use true or false Boolean values for evaluation, also I am not sure if you can pass multiple arguments in contains function, try the expressions

  1. ($DIFF_REC_COUNT<0) && (_PIPELINE_NAME.contains(โ€˜DI_AVT_DH_PERSON_TYPE_ODSโ€™) == true || _PIPELINE_NAME.contains.(โ€˜DI_AVT_DH_PERSON_LANGUAGE_ODSโ€™) == true)

  2. ($DIFF_REC_COUNT<0) && (_PIPELINE_NAME.contains(โ€˜DI_AVT_DH_PERSON_TYPE_STGโ€™) == true || _PIPELINE_NAME.contains(โ€˜DI_AVT_DH_PERSON_LANGUAGE_STGโ€™) == true)

I gave this in Expression:
($DIFF_REC_COUNT<0)==true &&
(_PIPELINE_NAME.contains(โ€˜PERSON_TYPE_ODSโ€™,โ€˜PERSON_CITIZENSHIP_ODSโ€™,โ€˜PERSON_LANGUAGE_ODSโ€™,โ€˜OCF_US_ODSโ€™,โ€˜OCF_MEXICO_ODSโ€™,โ€˜OCF_NETHERLANDS_ODSโ€™,โ€˜OCF_COSTA_RICA_STGโ€™)==true)

And got this errorโ€ฆ JSON o/p

[
{
โ€œreasonโ€: null,
โ€œfailureโ€: โ€œUnexpected error occurred while evaluating expression: SC@3ce966fbโ€,
โ€œresolutionโ€: โ€œPlease check your expressionโ€,
โ€œsub-expressionโ€: {
โ€œ0: $DIFF_REC_COUNTโ€: [
-2
],
โ€œ1: 0โ€: ,
โ€œ2: <โ€: [
true
],
โ€œ3: trueโ€: ,
โ€œ4: ==โ€: [
true
],
โ€œ5: _PIPELINE_NAMEโ€: [
โ€œDI_AVT_DH_OCF_COSTA_RICA_STGโ€
],
โ€œ6: โ€˜PERSON_TYPE_ODSโ€™โ€: ,
โ€œ7: โ€˜PERSON_CITIZENSHIP_ODSโ€™โ€: ,
โ€œ8: โ€˜PERSON_LANGUAGE_ODSโ€™โ€: ,
โ€œ9: โ€˜OCF_US_ODSโ€™โ€: ,
โ€œ10: โ€˜OCF_MEXICO_ODSโ€™โ€: ,
โ€œ11: โ€˜OCF_NETHERLANDS_ODSโ€™โ€: ,
โ€œ12: โ€˜OCF_COSTA_RICA_STGโ€™โ€: ,
โ€œ13: (โ€˜PERSON_TYPE_ODSโ€™,โ€˜PERSON_CITIZENSHIP_ODSโ€™,โ€˜PERSON_LANGUAGE_ODSโ€™,โ€˜OCF_US_ODSโ€™,โ€˜OCF_MEXICO_ODSโ€™,โ€˜OCF_NETHERLANDS_ODSโ€™,โ€˜OCF_COSTA_RICA_STGโ€™)โ€: [
{
โ€œ_snaptype_argumentsโ€: {
โ€œsearchStringโ€: โ€œPERSON_TYPE_ODSโ€,
โ€œpositionโ€: โ€œPERSON_CITIZENSHIP_ODSโ€,
โ€œignoredโ€: โ€œOCF_COSTA_RICA_STGโ€
}
}
]
}
}
]

can you use the exact expressions which I provided in my previous comments, and see if that works for you, I dont think you can pass multiple arguments in contains method

I solved this issue actuallyโ€ฆ
I gave this exp and it worked.

($DIFF_REC_COUNT<0) && (_PIPELINE_NAME.contains(โ€˜PERSON_TYPE_ODSโ€™)|| _PIPELINE_NAME.contains(โ€˜PERSON_CITIZENSHIP_ODSโ€™)|| _PIPELINE_NAME.contains(โ€˜PERSON_LANGUAGE_ODSโ€™) )

THanks for your quick response thoughโ€ฆ ๐Ÿ™‚