how can I check that my “inconfig(MyVariable).ToString” is empty or has a value?
I tried with a simple if statement
if “inconfig(MyVariable).ToString” = “”
then
MyVariable = “MyTest.xlsx” - I have added as asign activity with a value
else
it will give the value from inconfig.
But its not working… I’m doing it because … if under testing process file I do not wanted to run whole process then i can run the file and it will use that assign value.
If String.IsNullOrEmpty(inconfig(MyVariable).ToString)
Then
MyVariable = "MyTest.xlsx" ' Assign activity with the value
Else
' Do nothing or perform other actions with the existing value from inconfig
End If
I have a folder path inside the inconfig file… When i run project form MAIN file its working… im getting the path in whole project.
Feks. I have 8 files in project and I got an error in 4th file. Now I just want to run that file to solv the issue. My inconfig will be empty as im not starting project from MAIN.
So i just wanted to create an IF statement which just check if inconfig is empty then it should go to assign activity and get the folder path from there.
It’s throwing you error because in your config file MyVariable value is empty that why.
Instead of removing that from the config file, try the below way.
→ Use Folder Exists activity to check whether folder exists or not. Store the output in a variable.
→ Use If acitivity and the the output variable of folder exists. If true,do nothing. If False, use assign to assign the folder path.
As the workflow doesn’t get the input argument config dictionary from another workflow, the config dictionary will be null (Nothing). When it’s null, you get the null reference exception (“Object reference not set to an instance of an object”) when you try to get value for key “FileFolder”.