How to use Switch Activity in version 2026

How to use Switch Activity in version 2026. In switch activity i will pass Cell Value. if the cell value is 2 i have add new column using add data row activity, if the cell value is 3 i have add 2 new column using add data row activity.

@Vanitha_VS

What issue are you seeing in switch?

also instead of switch you might need to use loop with enumerable.range(0,cellvalue) and add data row inside your loop..so based on cell value the loop would run those many times and will add the rows

cheers

A better and more scalable approach would be to use a For Each loop instead of Switch


if you want to go with switch

@Vanitha_VS

Are you facing any issue? Or if you dont have any idea how to use switch activity, please refer below tutorial,

Happy Automation

  1. Drag and drop the Switch activity.
  2. Set the Type of Argument (String, Int32, Boolean).
  3. Provide the variable in Expression field.
  4. Add the required Cases and define the activities to execute.
  5. Last debug the workflow.

Hi @Vanitha_VS,

If this logic continues for cell values 2, 3, 4, 5, and so on, then instead of using a Switch activity, you can use a loop.

Set the number of iterations to CellValue - 1, and inside the loop use the Add Data Column activity to add the required columns dynamically.

This approach is more scalable and easier to maintain than creating a separate Switch case for each possible value.

Thanks