cancel
Showing results for 
Search instead for 
Did you mean: 

Read value action stage error or not correct

LorenzoCapocci1
Level 5
Hi Folks,
I am currently reading a collection/section value ( numbers) , but where a number begins with 0 (ie.0800), it doesn't pick up the 1st 0, but only the next 3 digits (ie.800).
can you help me solve this, as I need to capture the full digits..  the 0 is not included in all results but only in some occations.

thank you
9 REPLIES 9

Hi Lorenzo,

The most likely reason for this value to be read as per my guess is the data type of the 'Value Read' data item that you might be using. Can you check if the data type of the 'Value Read' data item is of type 'Text' and not a 'Number'. If the data type is 'Number' then the value will be read by eliminating the first digits which are '0'.


Let us know if it helps to resolve your query.


----------------------------------------------------------------------------------------------------------------------------------------------------------------------

If the answer resolves your query, please mark it as the Best Answer so that others can easily track the right answer.

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Senior Consultant - Automation Developer
Wonderbotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional

----------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please provide a big thumbs up so that the others members in the community having similar problem statement can track the answer easily in future.

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Technical Business Analyst,
WonderBotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------

LorenzoCapocci1
Level 5
Hi @devneetmohanty07
Currently all the actions are set to TXT
Collection below
34977.png34978.png

LorenzoCapocci1
Level 5
I think I will try to add a decision stage and concatenate action to see if that works out as this error should happen only when the value begins with 034979.png

LorenzoCapocci1
Level 5
Hi @devneetmohanty07
​Seems this update I just made it is working,  hopefully this will happen only in this type of scenario... thank you for your help
34980.png

PvD_SE
Level 12
I reckon a Regex action could perhaps solve your problem in a more simple and elegant manner. Google 'regex leading zeros', or similar, and you get a selection of solutions based on this.
Happy coding!
Paul, Sweden
(By all means, do not mark this as the best answer!)

Glad @LorenzoCapocci1 that your issue got resolved. However, what I meant was actually checking the data type of the data item where you were storing the value not the collection that was in the screenshot. Even though the 'Value Read' data item has been set up as the action stage's output, still there is a possibility can be a 'Number' data type if you have created it manually rather than the eraser button. I was telling this since I actually was able to replicate your issue at my machine when I set the Value Read data type as 'Number', hence that was my fair guess.

However, if all the data items are of 'Text' type then it should not happen ideally because at my machine also I am getting proper value with the leading zeros using the same action.

One thing I see that may pose a problem to your solution is if tomorrow let say your length changes or becomes dynamic. Better way in this case would be to first check if you have leading zeros or not using a Regular Expression like: "0+\d*" in the 'Test Regex Match' action. If you get a True value from this action, then get the number of zeros from the expression and then concatenate those many zeros at once. To get the number of zeros, you can use 'Extract Regex Values' action with the regular expression as: (?<NumberOfZeros>0+)\d* . Also, have a collection with columns as 'Name' and 'Value' and provide the value of first row for 'Name' as "NumberOfZeros". Once you execute the action, the 'Value' column will have all the leading zero's which you can the concatenate with the target string as per your logic.​
----------------------------------
Hope it helps you out and if my solution resolves your query, then please provide a big thumbs up so that the others members in the community having similar problem statement can track the answer easily in future.

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Technical Business Analyst,
WonderBotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------

LorenzoCapocci1
Level 5
Hi @devneetmohanty07
Thank you for your note, basically for this type of product rule it should never go over, but if does it is fine, but will discuss this with the SME of the product, and if that is a possibility I will follow, and in the mean time I would update this option (regex) with another robot I am working on, thank you  and also thanks to @PvD_SE
have a nice day​​

ewilson
Staff
Staff
Just to emphasize @devneetmohanty07's point. There are many examples on the web where DataTable's (which is what a Collection is under the hood) filled from Excel, CSV's, or other sources will result in this behavior. I don't recall ever seeing a really good explanation from Microsoft though as to why.

The work arounds you've already discussed seem to be some of the more common. If your source data is Excel though, you might check the definitions of those Excel columns to see what the cell data type is set to. Both General and Number formats will lead to this behavior.

Cheers,
Eric​

LorenzoCapocci1
Level 5
Hi @ewilson thank you for the comments, I will do more investigation, as the collection it picks the cell as TXT, so that I was kind of surprised, even my colleagues didn't have that situation before....​the file comes from a report, and if I find the cell current settings may cause this result, I will have to check if I should keep using this workaround, or I can have the report team to help update from the beginning....

Thank you all for your help and advise