How to pass string from queue work item into workflow

I created a for each loop for each item in the queue, and got the account number and stored it into a variable. I want to get the account number and process it in my workflows. How do I pass this variable into my workflows/sequences?


1 Like

once after getting the queue item variable, to get the value of each argument in that queue we need to mention like this

so for you it would be like this
yourqueueitemvariable.SpecificContent(“account number”).ToString

for more info on this
hope this would help you

Cheers @happygal321

1 Like

I’ve created separate workfiles to process each work item i.e Check account is balanced workflow, updated address workflow etc.

for each item in queue
get_AcctNum (variable)
invoke workfile activity: check acct is balance workflow
invoke workfile activity: update address workflow

In my for each loop, after I save the string into a variable using the method you provided (yourqueueitemvariable.SpecificContent(“argumentname”).ToString), how do I pass this into the first workflow of my sequence?

1 Like

@happygal321 - in your “check acct is balance” workflow, you should create an argument (i’ll call it in_AcctNum). Make sure it is a string argument with the direction “in”. Then go back into the main workflow and click “import arguments” on the “check acct is balance” invoked workflow. Then assign the variable get_AcctNum to the argument in_AcctNum

instead of just a string variable use a string ARGUMENT with OUT direction assigned with this queue item value, make sure that argument is created inside check account workflow in the arguments session (down next to variable panel)
so use that argument as a variable to store the queue item value (instead of get_AcctNum variable) like this
out_AcctNum = yourqueueitemvariable.SpecificContent(“argumentname”).ToString

–now while invoking this workflow in our main workflow using INVOKE WORKFLOW FILE ACTIVITY, click on IMPORT ARGUMENTS which will import all the arguments from that check acct workflow and so we would be getting the OUT ARGUMENT - out_AcctNum as well
–now in the value field mention a variable of type string named str_AcctNum in the invoke workflow argument window, so that the OUT ARGUMENT out_AcctNum is now assigned to the variable str_AcctNum and this variable can be used any where in the workflow
–make sure that variable str_AcctNum is a global variable that is the variable has global scope in the variable panel with whole sequence mentioned in the scope column so that it can be used anywhere in our workflow being global
–now if we want to pass that global variable to another workflow yah thats possible
we can create a IN ARGUMENT in the invoked workflow and assign this as value to that IN ARGUMENT while INVOKING a new workflow within the main xaml
say for example if another workflow that we are going to call now is update address workflow, create a IN argument inside that workflow, and while invoking in main click on IMPORT ARGUMENTS so that we would be getting that IN ARGUMENT in the import argument window, where we can pass this global variable as input to that IN argument (lets name it as in_AcctNum) of type string with direction IN
–now save the workflow and inside the workflow update address workflow we can use this IN argument to be assigned to any activity as input value,

–i would like to suggest here one thing like whenever the import argument is click and arguments are assigned with their variables as values make sure that the workflow is saved and if we want to view the argument list and value assigned to it click on ARGUMENTS property in the property panel of INVOKE WORKFLOW FILE ACTIVITY and dont click on the IMPORT ARGUMENTS again as it will freshly import arguments so we wont find any value in it @happygal321

hope this would help you
Cheers @happygal321

@Palaniyappan @Dave I am confused. I set up my orchestrator and was able to to add to the queue. I want to be able to grab the “argWorkItem” number from the queue and pass this into the process.xaml (im trying to use the reframework template). How would i do this?

1 Like

we can use Get Transaction item activity and get the output with a variable of type queueitem

–now use a assign activity like this
str_variable = yourqueueitemvariablename.SpecificContent(“argWorkItem”).ToString

now this str_variable can be used inside the workflow where we want like either we can send it to any activity as input variable in our main xaml file as that variable is a global variable
we can pass that as value to any IN arguments in process xaml while calling invoke file workflow activity by clicking on the IMPORT ARGUMENTS @happygal321

for more details

Cheers @happygal321

1 Like

@Palaniyappan This worked. Thank you

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.