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… 🙂