How to write Multiple "if" Conditions with out Using "Nested-if"

Hello Every one,

This is my input Data
Input_Data

Each and every row Satisfies the Four Conditions As shown Below

  1. Aa <>“NA” & Bb <>“NA” & Cc <> “NA” & Dd =“NA” ; Result=“SA+LOAN”
  2. Aa <>“NA” & Bb =“NA” & Cc = “NA” & Dd <>“NA” ; Result=“CC+LOAN”
  3. Aa <>“NA” & Bb <>“NA” & Cc <> “NA” & Dd <>“NA” ; Result=“SA”
  4. Aa <>“NA” & Bb =“NA” & Cc <> “NA” & Dd <>“NA” ; Result=“LOAN”

Output-
Result_Data

Here I am Using Nested If as shown Below

But i need to write this if Conditions by using Invoke Code or Linq. How to do that

My file-
IF_Condition_Exmpl.zip (9.8 KB)

Thanks
Regards,
Adarsh.

1 Like

Hi @adarsh_kotagiri

We can use multiple “if” in assign activity ternary operator logic, modified the xaml you attached. Check if it works for you.

If no condition is met, string.empty will be displayed orelse you can give your default value.

IF_Condition_Exmpl_Modified.zip (10.7 KB)

Thanks,

2 Likes

We can use a switch by simulating a bit mask

Building Block:
grafik

with the configured arrColset we build up the BIT Mask as String and will use it within a switch

Sample Data:
grafik

gives following output:
grafik

Find Starter help here:
Demo_CheckMask_Switch_4Cols.xaml (9.6 KB)

2 Likes

Hi @adarsh_kotagiri,

In this case, you can either go for using flow decisions in a flowchart or you can for using switch activity as suggested by @ppr also.

Regards
Sonali

1 Like

Thank you so much @ppr For creating the work flow its really working … i learned something new .

1 Like

Thank you so much @Boopathi.M its wroking too…

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.