Building the Workflow - Part 3 Help needed

Hello everyone, Im totally new here, so sorry if wrongly asked question, or wrong place to ask.
But im kinda stuck, for quite a while, and I cant really figure out what is the problem.

The instructor in the video is using some older version of Studio, so that already caused some issues even in the previous lessons, but I was able to solve them. BUT Im following each step EXACTLY like him, but I get errors.

Right now Im on the step where I add If statement, and then create the email draft.
I had everything working before I added IF statement. The invoices got downloaded, checked for discount eligiblity, wrote the discount in the invoice and it was saved, except that one invoice where there was no discount and it caused invalid VALUE in the excel sheet.

Thats why we are adding the IF statement, I understand, but since I did that, everything is broken, even getting the discount values, it seems like its doing it too fast, and it only gets one, and it applies all the same value to all the invoices.
So this is the first problem I am facing.

before I was also getting Write Cell: Object reference not set to an instance of an object, sometimes on THEN statement, sometimes on ELSE. but I did not change anything, just ran it in DEBUG mode, and now it worked, but with the above mentioned issue, that it only writes one value to all invoices, be it 0, or 125, but one value is applied to all.

And the last problem is is with the SEND EMAIL activity, it doesnt have access to the invoices folder? Why would that be? Any ideas please?

Would someone be willing to have a look at my Process? I Would be very grateful, thank you!

@martin.cierny ,
If you are doing this for practice purpose can you please share you xaml file.


Hi Jithesh,

Yes, its just for practice, Im only learning. Sharing the file, thank you for taking the time to help :slight_smile:

Main.xaml (56.4 KB)

Hi @martin.cierny

Please consider below points,

  1. If statement: Make sure that the condition is being evaluated correctly and that the correct actions are being taken in the appropriate branches of the if statement.
  2. Write Cell error: The “Object reference not set to an instance of an object” error typically occurs when you are trying to access an object that has not been initialized yet. Make sure that all of the objects that you are using have been initialized and that they are not null.
  3. SEND EMAIL activity: If the SEND EMAIL activity is not able to access the invoices folder, it may be a permissions issue. Make sure that the user account that is running the automation process has the necessary permissions to access the folder.

Kaviyarasu N

Hey @martin.cierny ,
As i observed in the save attachment activity You have provided folder path as “\Invoices”
Actually you have to provide Folder path.For example.


Like this. To save attachment you have to mention the folder(Full path is preferable) which is already available
Then the Attachment files will be saved inside that particular folder.
Here also you should make same changes inplace of “invoices/”


Thanks @Jithesh_R , I will try that.

Would you be able to advise why I am getting this error when looking at this IF statement?
“Write Cell: Object reference not set to an instance of an object.”

Thank you

@martin.cierny ,
I believe it is because of the same Mistake that is the path of the file is not proper that is why it is not able to update the cell because bot not able to find the file .