Create directory and save image in that directory, mention save image path as variable

HI,
I want to mention save image path in variable(screenshots save in newly created directory)
my work flow as follows

  1. Read Excel. gets data from excel.
  2. Create directory. Creates directory with name get data from Excel cell.
  3. Save Screenshot. i want to save screenshot in the new file created in Step2.

Flow is working well till this part.
4. Now I have many save screenshot activities, i want to mention the path as variable.
when i try doing this it is showing error “object Reference…”
i am able to mention any path name as variable except the created directory(step 2) path.
How do I achieve this?
Thanks in advance.

Yes you can store the file path In a variable
This error usually occurs s when the associated activity has a variable with null value
Kindly check that once whether rather variable we have used for dynamic storing value has some value in it
For that use WRITELINE activity and mention that variable and if it has value it will show us in the output panel or it won’t

Cheers @Divyatirunagari

i have give variable name Screen_path of type String
default “D:(backslash)”+dt_Page.Rows(int_CurrentTC).Item(" DID").ToString+“backslash” +DateTime.Now.ToString(“ddMMyyyyhhmmss”) +".png"

dt_Page.Rows(int_CurrentTC).Item(" DID") is the created folder in flow.
When the flow starts, there is no such folder to store screenshots, once it creates directory, the path exists to store screenshots.

I am able to store any other path except the directory path created on the fly.
can this be done?

Hi @Palaniyappan
am I clear? can this be done? any suggestions?

Before creating a directory with an activity use a assign activity and assign the same value going to mentioned in CREATE DIRECTORY to a string variable
Use that variable both in create directory activity and
here in the path as well
So that if there is a error in the path it will get failed at creating directory where we can find the error easily why happened

Cheers @Divyatirunagari

image
this is the problem am facing, when i run, it is not entering into the flow, directly getting the error message.
I tried the way u said, but still the same.
first directory has to be created with name same Excel cell.
later in the flow save screenshot in that path. I given path as variable.

I think the error is bcoz as path(as variable) is not existing at the beggining of flow.
I doubt is it possible to do?

Yes exactly so use that assign and create directory within Excel application scope and try once after read range getting the datatable output variable
Cheers @Divyatirunagari


This is what i did.
Still the same error
create Directory i gave string “Direcory”
image
and this variable “path” has image
Correct me if am wrong. Thanks!!