Cannot use workflow of library but it is possible with copy and paste within the process

I am facing a weird error. I want to use a library to reuse code. Especially the InitAllSettings.xaml of the REFramework (Link GitHub ReFrameWork). When I copy and paste the same code within the current process as InitAllSettings.xaml it works fine but when I use the same imported workflow via library the following exception occurs:

InitAllSettings: Column 'Value' does not belong to table DataTable.

Code snippet:

Config.xlsx excerpt:

As you can see, the Column “Value” exists. I do not know what I am doing wrong or if there is a bug.

Appendix: InitAllSettings.xaml (28.0 KB)

Hi @Phipsll,
You need to check where Excel data is being loaded. Using this part as library can make excel be out of scope.

1 Like

Hi @Pablito,

thank you for your fast reply. So there is no way to outsource the loading of an Excel file via library, all right?

Then I have to copy and paste the redundant code to every process as a workaround. Moreover, I could create my own project template for your this purpose.

I thank you for your quick answer.

What I meant is that you need to check in which exact step the excel data is loaded. It might be that the part you exported as a library is the part where activity which loads excel is not existing and this provides you to error. Hopefully you get the context :slight_smile:

Thank you for your answer but the Config.xlsx exists. The first column of the file can be loaded but not the second and third column. It really seems to be a bug. I do not really know what the problem is because the same Excel file can be loaded within the library and the process (if the Xaml file is within the process). Details can be seen in the screenshot below.

Hmmm, I’m not sure if I understand it correctly but you are talking about columns (second, third etc) which config file has only two - The name and the value. Actually seems that the case is that it can’t load the rows. This part is ok:
image
As in each variant you are “asking” process for first item (first element) of the first column. I don’t see where are you assigning the value (second element) of the first row/second column.
Something like:

row(0).Item(1).ToString or row(0).Item(“Value”).ToString

Here are the missing parts that you asked for:

The other Log Message activities, where the error occurs and at the bottom the tried adding of the Name and Value columns into a Dictionary<String,Object>. Moreover, the third column Description that is not used for loading into the dictionary but as a description/annotation.

Log Message activities excerpt of InitAllSettings.xaml workflow:

Config.xlsx, where the column “Value” cannot be loaded:

The InitAllSettings.xaml file that was making the troubles:
InitAllSettings.xaml (37.4 KB)

I thank you for your support and answers!

Something is completely wrong. Let me give you short example how to achieve it. I can’t understand your way of fetching this data.
This is my example of data file in excel:
image

Here how I’m fetching the data:

And the output:
image

You may find this project here. Just unpack it on the desktop.
Example.zip (37.1 KB)

Wow thank you for your effort. I tried your Example.zip (ExampleProcess) with the Main.xaml and it is working. But then I put the exact same code in an ExampleLibrary and imported it as package in your ExampleProcess and added the activity (loading the same settings.xlsx) at the end and suddenly it had the same issue as in my InitAllSettings.xaml beginning reading the index 1 (second column) of the settings.xlsx. So index 0 is working but nothing above. This behavior is the same as my problem from above (Cannot use workflow of library but it is possible with copy and paste within the process).

Example (Process) with ExampleLibrary activity:

You can test this behavior with the projects (Example, ExampleLibrary) and ExampleLibrary.1.0.1.nupkg within the zip file. Please just unpack it on your desktop.
ExampleProcess_with_ExampleLibrary.zip (69.1 KB)

As you said “Somethin is completely wrong” when loading Excel files via library. This issue seems really weird and unmethodical. I think that this is a bug.

Ok, now we’re on the same page and I started to understand what is going on :slight_smile:
Basically when you are creating library the path of any attached file is changing it’s location + package is not in folder but represented as a file. So if my excel file was attached from location

C:\Users\Pablito\Desktop\Example\settings.xlsx

Now it will be this location:
image

To avoid this you need to set in the potencial library project the input argument and when it’s ready attach the file from the outside of library using this argument.

Like this:


In my case it will lead to C:\Users\Pablito\Desktop\settings.xlsx

And the output is like this:

CAUTION!
But indeed there is a bug which I have reported already. Be sure that your Read Range activity have this quotes " "
image

Seems like when this is empty we will have this bug which provides excel file as an empty data.

1 Like

Wow, first of all thank you for your detailed answer and pictures. Everything makes sense and can be easily followed. :blush:

  1. Thank you for pointing out the different location behavior of the absolute path of libraries.

  2. You really found a bug with the Read Range activity property Range “” instead of empty string. Thank your for your effort and reporting of the bug.

Now, the library is working as expected. :+1:

2 Likes

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