07-06-23 08:50 AM
Hello team,
Please see my scenario below.
Excel Data - Collection - Empty by default - Used to read the Excel file with one of the column is "Name"
Number Data - Number data item that I want to concatenate with.
I need to append the text data item and number data item here so my expression throws the below error,
Here is the property of all 3 data items,
Please note that the same expression and calc stage runs fine in real-time without any error and it performs the concatenation fine, but here in the studio, it keeps showing 1 error.
Any idea on this?
Answered! Go to Answer.
08-06-23 02:40 PM
That is a compilation error that we get. At compilation time, the studio does not know the data type of [Excel.Name] and if I am not wrong it considers it to be NULL. When using concatenation with NULL and Number it gives an error as it will return a NULL value. But, concatenating NULL and Text WILL NOT give an error as it will return a text value.
In real-time your [Excel.Name] have some value so you are not getting Run time error. The worst is you will get column not find error if column is not present. Because if column is there then its datatype will be defined.
For testing you can just use any string operation on your number data type which will make it a string format and your compiler error will be gone. In short, you just need to have one String Data type in the whole concatenation operation and that should resolve the error
And just FYI, I don't consider it to be a bug in Blueprism. This is just how .NET compiler works and Blueprism is built on top of .NET framework. So, this seems to be an expected behaviour.
------------------------------
Kishore Deka
Lead Software Engineer
EPAM systems
------------------------------
07-06-23 12:20 PM
Hi T,
At the risk of asking something trivial: What if you put a value in 'Current Value' for data item [Number Data]. In the example you show the 'Current Value' seems to be NULL, which perhaps could be hard for BP to concat with the [Excel Data.Name].
07-06-23 12:39 PM
Yes, it runs fine. See below. Output was also generated but in the error pane, it keeps showing 1 error.
Now let's say I add more such [Coll.Field]&[Any Number Data Item] then for each such expression BP shows an error and when you run it works fine and does the concatenation normally.
I'm using BP 7.2 and checked in 6.10.5 also and observed the same behavior.
Sounds a bit weird to me Or maybe I'm missing something here!
07-06-23 12:42 PM
Hi
I think if theres a chance that the collection will have no data then your calculation will always fail. You would need to either define the collection columns with a blank row so this is default or you could add in some steps before to count the number of rows and if its Zero then do a different calculation stage where only the number data item is added to Output text Data.
07-06-23 02:34 PM
Yes count row check I can add surely but it will not resolve the above error.
Also, the Excel files are dynamic and the headers vary depending on the data coming from the target system.
And it involves multiple Excel files so it is not a good idea to create a collection with a predefined/static header for each of the Excels right.
07-06-23 02:54 PM
I think what i was suggesting, if the rows are zero, then to only add the number data to the output text rather than concatenate. Only concatenate in the event the excel data returns values. This would avoid having to define headers since the excel is dynamic and prevent an error on the concat calculation. Example below.
07-06-23 03:08 PM
Hello Michael,
Is your Number data item in the Text? Or is it Number only? For me, it is in the Number data item.
Because I'm still getting the error in the No branch because of the same expression.
------------------------------
If I was of assistance, please vote for it to be the "Best Answer".
Thanks & Regards,
Tejaskumar Darji
Sr. Consultant-Technical Lead
------------------------------
07-06-23 03:15 PM
With the same unknown collection, BP does not throw an error when concatenating [Coll.Text]&[Text]
See,
[Coll.Text]&[Text] = Expression Valid
[Coll.Text]&[Any Number Data Item] = No conversion available error
07-06-23 03:21 PM
Where the number of rows is zero then the calculation stage will only add the number data to the Output Text Data item,
Where the number of rows is greater than zero the calculation stage will add both to the Output text data item.
07-06-23 03:29 PM
Thanks, Michael, if possible can you send me this 1 test page where you did this testing?