Add the one value to existing Queue item during the process

In my Process i need to out one value from xaml - so I have created out_arugument. Out_argument outs values when everything is fine. but unfortunately if any error happens in the xaml am not getting the value in Out.

Eg: Xaml contains for 5 steps where am doing the out value in 1st step and error occurs in 3 steps of the process… Still am not able to get the value

So I have planned to Add the value in queue after the step 1 completed. So that can able to get the value from Queue from out of the xaml.

Note: The error position might occur in any step inside the xaml and my purpose is need to get the value out from the xaml even any error occurs

Any suggestion to overcome this pls - Thanks in advance

Hey @Fresher

You can instead try with an easy step by adding a try catch block inside the workflow for bypassing any type of exceptions. So it won’t affect your workflow and you can get Out_argument value too.

try{

—your activities—

}catch(exception){

—Keep it Blank----}

Regards,
Goutham

You need to do proper error handling in your automation so it doesn’t just quit when there is an error.

@postwick and @GouthamVijay

Thanks for you information.

But could you please help me some Xaml file for reference. Because i tried the same as you both were addressing (Proper error handling ) - Its unfortunate that i cant attach my Xaml here. but i will try to share some verbos of my code structure

Try - block
–sequence ( contains of 3 steps)
1) Assign Out1 = “Test1”
2)Click some element in browser
3) Assign Out2=“Test2”
Exception block
Nothing
Finally block
Nothing


So i Purposefully closed the browser to induce the error on 2nd step in try block.
even the error is captured in exception block am getting null value outside of the sequence for the Out1 argument

You don’t need to attach XAML here. Use Snipping Tool to take a screenshot of your code and then you can just directly paste it into your reply here.



Hope this is enough!! @postwick

Seems like that should work. Try putting a Log Message in your Out_test.xaml Catch. See if it has a value when it gets to that.

You can have the default values for the variable.
inside the workflow, have an exception handling sequence

If the robot has passed the step where the variable is updatdd, then it will have the updated value
else it will hold the default value

This way you will have either the default value or the updated correct value.

Hope this helps!

@postwick

Hope i did Proper error handling the code.
And yes Even in catch block also am not getting the value.
image

Getting only Null value…

@rahulsharma - Thanks for your information , Yes that was my plan also, however the value which am expecting to out is critical and replacing that with default value will have to do some kind of manual work by user when they look the final report.

So ly thinking of to other ways to get the value as out

why default value needs to be entered by the user?

In the variable panel of main just, just put the default value for variables

that will be the value of a variable if the robot failed before updating value of that variable in process

@rahulsharma

My intention of request is to get the valid value which out during the process.

Assigning the default value will be static one and neither its valid nor proper information…

so obviously user need to do some manual work when look default value in the report.

eg : If am taking the account number as out which is not static through out the process and any error occurs we are updating with the default value like “Default account” .When they got the summary report or they manually need to look out for Account number for that transaction.

Hope am clear :slight_smile:

Would be great if you can share the ways to get the out value - Thanks.

Dear @Fresher

you are expecting that a value should be there and that should be a correct value? that is possible only when there is no failure in that workflow.

You mentioned of there’s any exception, you need the out values. that will be there if you use default value and try catch inside that workflow.

But if there’s an error, there will be no value fetched for that variable that gets updated on that workflow. right?

So what you can do. If you have multiple value extraction activities, check the checkbox from property that says ‘Continue on error’. This will continue the existing execution of one oh the value extraction activity fails and will continue with further extraction and update the variable.

and yes, in cas e of genuine exception if there’s any default value in the report → you can either not show the report ans her or rectified by someone and then send OR you can mention the error, Error in extracting this data and then user can check it manually.

You csn manage in multiple ways. Just try to be realistic, getting correct values from a workflow even if there’s an error in between inside that workflow isn’t a realistic statement.

If there’s an error → you can try to fix something to avoid exception and make it more stable.

more than happy to connect and discuss over this.

@rahulsharma

Thanks much for your explanation.

From 1st paragraph of you comments I understood it’s not possible to get the output if the xaml has any error.Which even am aware and that was my initial thoughts.

Am really grateful to this forum which solved many of problem where I initially I thought there is no solution .

My thought was the assign is happening in the first step where the value is assigned to out argument and after which only error happens. So why the value is not able to get from outside of the xaml where the value is already assigned. I felt that is something realistic. Which might be wrong as well…

Just wanted to know is there any other ways to get the value and that’s reason of seeking help here

Either way i already used that alternative approach of assigning the default value.

Thanks again for your time and appreciate it!!

Hey brother, appreciate your thoughts…

yes this is possible. If the value is extracted, just assign directly to the out_Argument in the flow. If the error happens after this, there is try catch that will take care of error but the out_Argument will hold your value.

@rahulsharma

Possible?? Initially you have mentioned it’s not realistic!!! Bit confused :roll_eyes:!!

Wondering if you have to some time to look over my above post with screen shots. If not I can explain again…

Where I used try catch but still the out argument doesn’t hold any value and it’s returning as null…

Just curious to know the solution…!!

This above thing is not realistic, getting the correct values even if the activity that gets that value fails/gives error

This is realistic and possible. That’s why I mentioned the quote and said this can be done in the above mentioned way. Give it a try. It will work

@rahulsharma

Am again requesting you to look over above screen shots…i have tried, unfortunately it’s returning null value…

If you verify and correct me if there is any mistake that would be really grateful.

Happy connecting with you brother, as we replicated the scenario it is working

Do check the workflow, you will get something that is wrong in your workflow

testVar.zip (11.8 KB)

1 Like

Sure…Thank you so much @rahulsharma

1 Like