We’re working with an excel spreadsheet to make some changes in our CRM. Column D tells us the type of business and Column C tell us if it’s an a subsection of that business. I need to make a rule that says if Column D = PL, check if Column C= VIP, if yes do XYZ. If Column D= CL, do XYZ. How to I set the variable correctly, to be able to use an If Statement?
Excel Application Scope (Specify Excel file path)
└─ Read Range (Output: dtData)
For Each Row (ForEachRow in dtData)
└─ If (row("ColumnD").ToString = "PL")
├─ If (row("ColumnC").ToString = "VIP")
│ └─ XYZ actions
├─ Else If (row("ColumnD").ToString = "CL")
│ └─ XYZ actions
└─ End If
Answered By LLM to better organization, hope that helps
You can achieve this using a single IF Condition activity or two if you prefer.
Single IF Condition
Condition:
((row(“COLUMND”).ToString = “PL”) and (row(“COLUMNC”).ToString = “VIP”)) Or (row(“COLUMND”).ToString = “CL”)
Then:
Do XYZ
Else:
Do Nothing
Two If Conditions
If Statement #1
Condition:
(row(“COLUMND”).ToString = “PL”) and (row(“COLUMNC”).ToString = “VIP”)
Then:
Do XYZ
Else:
Do Nothing
If Statement #2
Condition:
row(“COLUMND”).ToString = “CL”
Then:
Do XYZ
Else:
Do Nothing
.
…
.
Note:
you need to swap out the capital letters for actual column names.
you may need to put the values to upper and trim depending on your data (.ToUpper.Trim)