I have a excel file containing Active and Inactive employees (0-Active and 1- Inactive) with employee IDs. Using conditions i am fetching all the active employees from that excel file and pasting in a new excel file.
But it pastes the employee id and Active status with a point decimal, for eg for a record whose employee id is 10001 and status is 1 (i.e. active). It pastes employee id as 10001.0 and status as 1.0.
How to remove that .0 part?
Why don’t you try pre-format the cells of the column A so they will have no commas?
I have pre-formatted the columns by using text to column but it works only after manually editing/ writing to the respective cells.
So it is not efficient to do this manual task every time after the result is stored in that excel. And also records which are being filtered in my script are about 500+ records
Also after filtering and storing result to excel file i am using that excel file further in other script to do some operations.
That’s why I need some function or a method in rpa express which will insert records without .0 part wherever numbers are used.
Excel File that i am using for filtering is already formatted as text type. PFA SS of that file below:
Not viewing your actions in details makes it quite difficult to guess the reason of this issue.
Could it be that you when you format the ID number to a String (in order to past it to a cell) you use “0.0 Format”:
Thank you v.much for your help.
It worked fine when i changed the condition IF (Column Contains “1”) to IF (Column = “1”) and excel file with .xls (previously i was using .xlsx)
Now only the number is being pasted instead of .0 part which was the goal.
I know this isn’t as genuine solution but i also don’t know why this worked as there is no change in logic of workflow.
main excel file:
I am glad that you were able to resolve it somehow.
But have you checked your Number Format action, which I have shown you in previous message?
Yes i tried what you suggested, Doubt i have is that,
As per my workflow the row which has status 1 will be fetched and appended to the table (‘active’ in my variables) and i will use the number format on required data (i.e. emp id and status), but the output will be stored is in a string variable (whatever i define) and not the ‘active’ table variable. And after fetching active emps i will be pasting ‘active’ table to the excel file.
So how can i use number format on a record/element of a row of a table or a list type and save it on another table or list type after the formatting operation.
I haven’t understood your question if it was a question…
Usage of Number Format is simple enough, just don’t forget to change the Format to your needs.
Hi @vitaly_pustoZi, When i use number format there will be Type Casting exception (between list and output string of number format) so how to avoid that, was my doubt.
Also i was using number format after the loop which was incorrect.
But thanks to screenshot provided by @ashapkina it became clear and desired output was achieved by that also.
Thanks v.much @vitaly_pustoZi and @ashapkina for your help.