Currently i build the workflow as below whereby i use get text tool to extract data from web browser and add row to be written into the excel file:
However, my outcome in the excel will be something like this:
There will be empty row if no result found from web since i only put in the one side (left side) of the workflow as per screenshot below:
May i know how can i build the workflow on the right side as per screenshot below so that if does not contain " one record found", fill in the excel cell with o instead.
This is my desired outcome in excel as per screenshot below:
Reason being i consider adding “0” for those no result found is i noted that the result generated will be not correct because UiPath will add row by row whereby it is not accurate result.
Or u may ignore on what i did because i may do the wrong way. Need some guidance on how to do it on the right way.
Basically the whole process is i ask UiPath to read the excel data and key in into the web browser. After that i want to get some text if there was record found. But this cause the problem whereby data generated not accurate as i did not consider those no result found.
Hence i am thinking of adding hardcoded value "0 " for those no result found to try if the data generate would be accurate since i consider both scenario.
Not sure if you understand it or not… I will try to explain it if you not really understand the logic that i have explain.
@SH_94 I don’t have laptop with me so I can’t help with the screenshots,but If I understand correctly the process is in for each row activity,if it is we don’t have to use add datarow activity(remove add datarow activity), instead use an assign activity and give currentrow(“Status”) = “one record found” in then part and in else part give currentrow(“Status”) = 0
And write the datatable (variable used in read range activity) back to the excel.
You can also try the method1 I gave as it is easy and faster.
@SH_94 yes it will change all the empty value in Status column to 0, hope you are using the write range at the end of the process use the invoke code before that.
I have solved similar query to this on other topic , you can refer that for how to use the invoke code,
This is my formula under the edit code: dt.asenumerable.where(function(row) string.isnullorempty(row(“Attachment Found”).tostring)).tolist.foreach(sub(row) row(“Attachment Found”)= 0)
While for argument, i put as below:
Actually why i want to keep as zero for No records found is UiPath seem to give me wrong data as per screenshot below ( this is before i use the invoke method).
Technically, if no records found, it should give me blank . But in this case, Uipath seem to capture wrongly.
Do you understand on what i am saying and trying to do here? Let me know if you not understand on it and i will present it in more understanding and clear way.
For the error, I can see that you have passed string, we have to pass datatable extractdetail.
Create as argument called dt of type datatable and pass extractdetail.
And as for the wrong details updated on the excel, I could not find where it is getting wrong with the screenshots, can you share some more screenshots of the process and what are doing with add datarow.
You have already added condition to check the rows whether it contains “one record”
If yes you will add column 1 and column 2 value
If not you want to add 0 in the second column which is blank
So In add data row in else added the same column 1 and in column 2 as “0”