Unable to pass value to another workflow

Hi, I have been facing the issue of data not being able to pass to another workflow when run.I extracted the value from fakename site generator as out argument, binded them as in to the workflow for the myCrm app but it gets the data stores in excel but doesn’t pass to the app.
Please help!

1 Like

But you haven’t mentioned how you are passing the values and what exactly the problem ?

I got the extracted values from the site and I want to pass the extracted values to the app but it gets the values, opens the app but doesn’t type in the extracted values

can u please provide the workflows where you are passing the data

Have you definitely passed the values in in the right data type? It may be that you cannot type them into the myCRM app if they have passed as something other than string for example.

Hi @stanstilo

I suppose you are extracting values from the fakename site generator in a separate workflow. and you want to pass that to another workflow which uses it to write it in myCRM application.

In that case, what you have to do is as follows…

In the first workflow (which is used to generate the names), get the name from the site into a variable, and assign it to the output argument of that workflow. So this will help to return the value to the main workflow. In the main workflow, you should have another variable to hold the value that is given as an output from this workflow file. You can handle these stuff in the Invoke Workflow activity as you may already know…

Now, in your next workflow that do the writing in your CRM app, pass the variable you created to hold the output value of the previous, as an input argument for this workflow… again in Invoke Workflow activity.

Now, in your second workflow, you will have that value available to write into your CRM app…

Hope it helps!! If it doesn’t it would be great if you could share your workflows so we can take a look!! :slight_smile:

Thanks
Lahiru

What is the error, can you share the screen shot ?

Thanks Lahiru for your detailed response, however it worked for the enter user data, however I will still let you know if encountered any error, as I am still working on it.

1 Like

Hi Lahiru, I encountered an issue, I tried passing the data from the excel file to the CRM app and I got an error; Failed, Index was outside the bounds of the array. Please help!

Hi…

Will you be able to tell me at what activity you are getting the out of bounds error? This error occurs when you try to access a data element which is not available in datatable/ array/ list etc…

So i believe you are using a datatable or an array to hold data in the excel… and looping through that to write to CRM. Try debugging option and see where exactly the error is thrown… could you show me a screenshot of that part… that would be great…

This is where it shows the error and it didn’t write any data to myCRM, what could be the reason

I have shown the screenshot

I’m suspecting the two input orguments Fname and LName…

Shall we try this… Could you add a Message Box or Write Line activity just before the Invoke Workflow activity, and add the output of that as:
Rows(Counter)("Name").ToString

This will show you what value it holds at the time you try to invoke the workflow… If that provides an output… Then try showing the value for this:
Rows(counter)("Name").ToString.Split(" "c)(0)
and Then
Rows(counter)("Name").ToString.Split(" "c)(1)

I’m wondering whether it has a value for the (1) position after split… could you check it out and let me know the values you get for those?

It displayed no values

if Rows(Counter)("Name").ToString does not show any values, that is the cause for the error. Because, when you explicitly specify the split and the position of the split, when there are no values, it cannot locate the position you mentioned as (0) or (1).

So we will need to check why Rows(Counter)("Name").ToString is not getting any values.

I believe Rows is the row item used in a for each loop. So, you must be having an array/ list or a datatable. Check whether those are initialized with any values… That would help to sort it out… To get a clear picture of whether it gets assigned with any values is to add some break points and use the debug mode to run your workflow step by step. That way you will be able to check the values in the Locale panel :slight_smile:

Hope it helps… if not, would be good if you can share the workflow file so I can have a look at it if its okay with you…

project.json (705 Bytes)
2InsertUsers.xaml (27.9 KB)
1GetUsers.xaml (14.6 KB)
Thanks please help me check the cause

Hi @stanstilo

Sorry for the delay in responding to you… it was midnight over here :slight_smile:

I went through the files you shared… This is what I found…

2InsertUsers.xaml is your main file… and you have a separate file named “1GetUsers.xaml” which is not called from your main workflow.

The thing common in these two workflow files is, you have a datatable called “usersDT”.

Let me break this down into two sections to explain easily.
Scenario 1:
In your 1GetUsers.xaml, you have a build data table activity to build the usersDT. and at the very bottom, you have “Add Row item” to add records you extracted from fake name generator. which is fine…

Scenario 2:
2InsertUsers.xaml is your main workflow where you check various things and try to insert the extracted values to the CRM app.

  • Load Users sequence

    • Again you have another build data table activity that creates a datatable named “UserDT”

    • Then you have few activities to extract data from an excel, but at the end, you have an assign activity to assign values from userDT table with a filter to a datarow variable called Row.

    • Here, at the time you are trying to assign to the row variable with this usersDT.Select("Status is NULL") condition, i don’t think there is any value assigned to the userDT datatable which you have created at the top.

I believe you should get the userDT datatable in 2InsertUsers.xaml file assigned with the values you extract from 1getUsers.xaml file right? If you get that part done, it will perfectly get the values to the userDT datatable in your main workflow, and the rest will fall into place automatically…

Hope it helps!!

Let me know if you need further support in this… would be glad to help!!

Sorry, didn’t get the message on time. Please what do you mean by assigning the built usersDT with values. Do you mean assigning the values from the getUser using add data row to the usersDT in the insertUsers sequence.

Hi @stanstilo

Yes, the UsersDT datatable in your InsertUsers sequance is not getting initialized at any point (based on the files you sent). I think you should get the usersDT datatable returned to the InsertUsers sequence and get it assigned with it.

Since your InsertUsers file has the main workflow, you can use an invoke workflow activity in it to execute the 1GetUsers.xaml file. Then in GetUsers xaml file, pass the UsersDT onto an output argument which you can use in the InsertUsers workflow… That can then be assigned to the UsersDT in your InsertUsers workflow…

Makes sence? Let me know if its not clear.

Hi Lahiru, thanks for the info, With your explanation, I have been digging out the issue but have not gotten through though. For the split in the firstName and LastName row, I removed the idex (0) and (1) to see if it will work with the fullnames, the error index not bound in array disappeared It runs without error but no values were entered into the myCRM app. From what you said I created usersDT as an argument in the GetUsers.xaml and passed it as in to the InsertUsers.xaml.
Please help!