In/Out argument goes back to in value

Hi everyone,

My problem seems to be very basic but it is driving me crazy. I have a simple workflow with an argument which is used for a if condition. If the condition is met then this very same argument is changed with another value (that’s why it is an in/out argument).

The problem is that the value entering the workflow (in) remains the same when exiting the workflow (out) but it should have been changed because the if condition is met.

Using the debug mode, I can clearly see that the if condition is met and the argument is properly set to the new value. But at the very end of the workflow the argument goes back to the in value.

I have already double checked that I don’t have any other argument/variable with the same name.

Here are some screenshots where you will see the arguments changing throughout the workflow.

  1. The argument io_Grp3 (in value) contains the code FCT, which allows to meet the if condition.

  2. Thus this very same argument is changed to WLC. As you can see in the screenshot it is working (even until the Click “Button Continue (enter)” activity).

  3. But once leaving the workflow, the io_Grp3 argument goes back to FCT and I don’t know why :sob:

What could be wrong?

Hi,

Could you pls check do you have any default value set in the arguments panel. if we have any default value then in that case we will get the same value as output. share us the screenshot of the arguments panel. thanks.

1 Like

Most probably, you might have the same variable name in your variable pane. Just check it once

Apologies… I should have read it first.
Please ignore this comment

Thanks for your reply. It is actually not possible to define default values for in/out arguments (and out arguments as well) in the arguments panel.

This is clearly not where the issue is coming from :slightly_smiling_face:

Yep, that is what I thought too. But I have double, triple (and more) checked.

I have also replicated the sequence in a fresh new workflow and created from scratch the variables and arguments. I am still having the issue :confused:

I know this might sound dumb… but at times, Because it happened with me i have created the same variable but the scope was just one level and I was not able to pinpoint to it. later realized what actually happened… If you can give it a look.

HI,

it is possible from my side i am able to enter default value in the in/out argument. please refer the below screenshot. the correct way to store is we have to use string variable it will hold the dynamic output. And also please check whether you are using correct Direction-> in/out . thanks.

Yes, I have checked in every part of my sequence to make sure it is not “hidden” by the scope.

And again, I have replicated the sequence in a new workflow, from scratch, with new arguments and variables and making sure I have created them just once, and it is still not working.

Oh ok, I see what you mean. The arguments panel once you invoke the workflow, not in the workflow itself.

So, to answer you, my value when invoking workflow file is also an io_Grp3 argument (actually it is a second layer of a bigger workflow).

@Suldarie

Can you share the screenshot of output Arguments of your workflow?

Thanks

ok there is no issues till now. but some thing is missing that is creating pain. one last thought from my side. the variable io_Grp3 you are assigning into this argument has any default value pls check. thanks

Trace your activity and check value at each level and see when your value changes

Well, I have been able to find a solution to make this step work, although it doesn’t fix my issue.

I am going to remove the workflow which makes me having the issue and place the sequence in the above layer. It seems to work even though it’s not how I exactly wanted to handle this part of the process.

If you guys have any solution, I would still enjoy reading it :slight_smile:

I have checked and I see no default values.

I already did (see my first post). It is working until it’s leaving the workflow (the very last step).

https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/out-parameter-modifier

Check this out… I believe this is the reason

you have to save your in/out to a variable and then pass it to next level of argument and receive value in that variable and pass it to outer argument

Like I said before, One of the arguments you are using is Out and not in/out, and out can not be overloaded as in/out argument. Change it either to in/out or store it to a variable.

I am attaching a ref project. Change argument type of XAML Flowchart to out and in/out and do two different runs and you will see the difference.

BlankProcess3.zip (5.6 KB)

That makes sense, except that the argument used, in both workflows, is in/out (I have checked again). :confused:

1 Like

I am out of options for now, Well can you help me with your both XAML or if you can make a generic scenario to see if that happens or not?

Hi @Suldarie

Maybe this will work , change the in\out argument datatype from string to dictionary and also you can refer to this thread

I hope it will help you

Regards
Sudharsan

2 Likes