cancel
Showing results for 
Search instead for 
Did you mean: 

How to Pass Value only when condition is true

0 Kudos

Hi Experts,

Please give me a UDF where value will be passed only when true. I have attached screenshot for your reference. And when it is false i want the output to be returned as suppress only or an empty value. Please let me know if it is possible.

Thanks and Regards,
Karthik

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member190293
Active Contributor
0 Kudos

Hi Karthik!

To keep values for "false" condition in IfWithoutElse you can use parameter "Keep SUPPRESS values" in function settings. Thus you'll get "SUPPRESS" value when you condition check result is false.

It worth mention that you should have equal number of elements with context changes in both of input queues for IfWithoutElse function in order to get expected output.

Regards, Evgeniy.

0 Kudos

Hi Evgeniy,


Thanks for the reply,

But i have purposely removed the contexts. Is it possible through UDF to pass value from then only when the value at if is True !!

iaki_vila
Active Contributor
0 Kudos

Hi Karthik,

Your issue is because you need to have the same number of values in the "if" and in "then" sections. I suppose that with CRM values you don't have values in the "then" section. If you set the context upper in the "then" section, have you get all the context needed?.

Regards.

0 Kudos

Hi Inaki Vila,

Thanks for the reply.

I have disabled the formation of E1IDPU1 segment when it is DOCNAME = CRM as it was creating issue at Bank end. I just need MOABETR value from CRM to be formed when DOCNAME = INV and when MOAQUAL = 005

So i Need value from CRM>MOABETR whenever it is INV..


And from (then) other conditions are there so that only CRM MOABETR values come. If i enable contexts, then in at second if then condition (as in screenshot), the required value wont be mapped to INV so i have removed the contexts..

Please find the below screenshots, If i am able to pass the value through second If without else condition then i will get the value in the second invoice segment.. So please let me know if it is possible to pass value only when true at second if without else condtion with the help of UDF.