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.
07-06-23 03:47 PM
++
07-06-23 04:27 PM
Please see attached, keep in mind this hasnt been fully tested and i had no test data for it but hopefully this does what you need to do.
07-06-23 04:36 PM
Thanks, Michael, I imported your page and I see the same error popping.
I'm wondering why it is showing in my BP but not in your BP. I'm using the latest BP 7.2, which BP version are you using?
08-06-23 08:39 AM
ah sorry i should have been clear this wouldn't eliminate the error this is only to avoid a failure in the process when running. The error will still exist because the value from the collection cant be defined until runtime after you get the info from excel so the list of errors will still show unknown value. Ideally there are no errors but with the scenario you presented if you cant pre-define the collection then this might have be an acceptable error to leave in your process.
08-06-23 10:00 AM
Okay glad you got my point now.
Awaiting for others to reproduce and confirm.
I have a strong vibe that this is a bug.
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
------------------------------
08-06-23 03:35 PM
If you concatenate with an empty string in between it will not show the error as you are letting BP know to make a casting
[Excel Data.Name]&""&[Number Data]
Maybe this will help with your situation.
09-06-23 07:53 AM
Thanks @Kishore Kumar Deka, that makes a lot of sense now. Also, the workaround @sekou dioubate suggested works and removes the error because any Text concatenates with a Number results in a Text here because both are known to .NET and then it became a Text itself which in turn now become Coll.Text&Text.
Thanks again for this knowledge.