Write into excel from If condition

Giving the following the flow I want to write in excel.In this format

Title. Check/Uncheck
Abc. Checked
Bcd. Unchecked
Effg. Unchecked

How should I write it in excel from If condition


Thankyou.

@Bhushan_Nagaonkar You can try using the ‘Write Cell Workbook’ activity.

1.So in the if(Checkbox), under ‘Then’ you can use ‘Write Cell Workbook’ to write the title and Checkbox status(Check).
Similarly for the ‘Else’ condition you can write the status as ‘Unchecked’

2.Make sure to increment the ‘Cell’ option in the activity after every write operation

Hi @Bhushan_Nagaonkar

Use Write Cell activity

I hope it helps!!

Will it write one after another??
Should I use write cell in both of the then and else or after the if condition?
How will I seperate it.

Between two columns

@Bhushan_Nagaonkar
Both then and else conditions give write cell activity
Check auto increment row option in write cell activity then it will write one after another.
image

Hi @Bhushan_Nagaonkar

Use for each to iterate through excel file:
if (is checked):
then use write cell acivity with auto increment row checked to true
else
use write cell acivity with auto increment row checked to true

“This increments only the destination cell and it is meant to be used inside a ForEachRow activity. The From field is using the Current Row, so it will go through all the rows in the range.”

image

1.You can specify the column name by typing it in the ‘Cell’ option in the ‘Write Cell Workbook’ activity.
in the above example “B” is the column and index.ToString is the row. This index has to be incremented every time you perform a write operation.

2.You can also try using ‘Write Cell’ modern activity and set the autoIncrement option and you will have to use it in a ‘Use Excel File’ scope

Hello thankyou for your time help @lrtetala @Brian_Mathew_Maben @supriya117

I have tried abovr method but the values are just getting.

I have placed write cell activity depending on the values in then else.

It has 11 values it shows less because it gets replaced.

No I didn’t get the solution I have for an issue. The values are getting replaced. The data is getting interchanged. Am i doing something wrong @lrtetala

@Bhushan_Nagaonkar

Then use write cell workbook activity

@Bhushan_Nagaonkar

Then give increment like this:
assign: Count = 2 (because starting from row 2)outside for each
In 1st write cell: Excel.Sheet(“Sheet1”).Cell(“A”+count)
In 2nd write cell: Excel.Sheet(“Sheet1”).Cell(“B”+count)

Outside if condition: assign: Count = count+1

Actually I’m already using count. I have used for getting checked Unchecked values.
My count starts from 1.

Thats I have used if condition to separate check/uncheck values

@Bhushan_Nagaonkar Try using this
image
In this the index will be incremented using ‘Assign’ activity.
So if you place this in the ‘Then’ and ‘Else’ block, the index will keep incrementing and it won’t rewrite the cells

@Bhushan_Nagaonkar

Try like this

What about the count that I have already used to iterate the while loop?

Should I use another variable?

@Bhushan_Nagaonkar

Then change the variable name to something to increment the cell value.
That’s count for getting Ui elements.

Yes you can use that as well.
The while and for each activities provide and index option in the property panel. So you can make use of that

I tried using this not working.

Index as 2

Tried both not working

@Bhushan_Nagaonkar

Can you show the screenshot how you are trying