cancel
Showing results for 
Search instead for 
Did you mean: 

Query on expression error

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,

27862.png

Here is the property of all 3 data items,

27863.png

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?



------------------------------
If I was of assistance, please vote for it to be the "Best Answer".

Thanks & Regards,
Tejaskumar Darji
Sr. Consultant-Technical Lead
------------------------------
1 BEST ANSWER

Best Answers

Kishore_KumarDe
Level 4

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

27846.png

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
------------------------------

If my answer provided any assistance, please vote as "Best Answer". Kishore Deka Lead Software Engineer EPAM systems Connect on LinkedIn https://www.linkedin.com/in/kishoredeka1410/

View answer in original post

17 REPLIES 17

PvD_SE
Level 12

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].



------------------------------
Happy coding!
---------------
Paul
Sweden
------------------------------
Happy coding!
Paul, Sweden
(By all means, do not mark this as the best answer!)

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!

27778.png



------------------------------
If I was of assistance, please vote for it to be the "Best Answer".

Thanks & Regards,
Tejaskumar Darji
Sr. Consultant-Technical Lead
------------------------------

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.



------------------------------
Michael ONeil
Technical Lead developer
NTTData
Europe/London
------------------------------

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.



------------------------------
If I was of assistance, please vote for it to be the "Best Answer".

Thanks & Regards,
Tejaskumar Darji
Sr. Consultant-Technical Lead
------------------------------

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.

27788.png



------------------------------
Michael ONeil
Technical Lead developer
NTTData
Europe/London
------------------------------

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.

27791.png

------------------------------
If I was of assistance, please vote for it to be the "Best Answer".

Thanks & Regards,
Tejaskumar Darji
Sr. Consultant-Technical Lead
------------------------------

With the same unknown collection, BP does not throw an error when concatenating [Coll.Text]&[Text]

See,27795.png

[Coll.Text]&[Text] = Expression Valid

[Coll.Text]&[Any Number Data Item] = No conversion available error



------------------------------
If I was of assistance, please vote for it to be the "Best Answer".

Thanks & Regards,
Tejaskumar Darji
Sr. Consultant-Technical Lead
------------------------------

Where the number of rows is zero then the calculation stage will only add the number data to the Output Text Data item,

 27800.png

Where the number of rows is greater than zero the calculation stage will add both to the Output text data item.

27801.png



------------------------------
Michael ONeil
Technical Lead developer
NTTData
Europe/London
------------------------------

Thanks, Michael, if possible can you send me this 1 test page where you did this testing?



------------------------------
If I was of assistance, please vote for it to be the "Best Answer".

Thanks & Regards,
Tejaskumar Darji
Sr. Consultant-Technical Lead
------------------------------