Time Conversion Issue in Linq

Hi @supermanPunch

Total hrs Time format : 5.11.00 AM

Thanks
Shyam

@Shyam_Pragash ,

Could you use the below Expression and Check :

If(TimeSpan.Parse(Split(CurrentRow("Total hrs").ToString)(0).Replace(".",":").Trim).Minutes>1,"Less Mins","More Mins")

Hi @supermanPunch

On you share code…

Expected Output:

image

Input Data:
Book1.xlsx (8.6 KB)

Thank
Shyam

@Shyam_Pragash ,

I am not sure I understand you. Could you explain what was the result that you received when you used the Modified Expression ?

Hi @supermanPunch

Total Hrs is input data to fill into Status
column (done or Not done), if Total Hrs is present & it’s greater or equal to 1 mins write in Done (Status Columns). in case the cell empty or null Write in Not Done in (Staus columns)… All Other empty Cell fill Date time 00:00:00.

i think is it clear for you…

Plz refer Expected Output and Input data Attached in Excel sheet.

Thanks
Shyam

@Shyam_Pragash , When Inspected the Total hrs Column format using a Write Line Activity, the format seems to be the same as that of DateTime.
image

Could you Check the same using a Write Line Activity from your end ? To confirm if that is the case ?

Hi @supermanPunch

My End shows Total Hrs

image

Thanks
Shyam

@Shyam_Pragash ,

Do you have PreserveFormat Checked in Read Range Activity ?

image

Hi @supermanPunch

Updated One

Sharing the Status report.csv file for your reference…

Status Report (2).zip (372 Bytes)

Thanks
Shyam

@Shyam_Pragash ,

For the time being, Just Check if the Below Workflow gets the Output as required :
DT_ConditionUpdate_Rows.zip (10.0 KB)

We can move into different aspects or different data if this works.

Hi @supermanPunch

Thanks You…

But i have many columns… Can you share me on linq

Thanks
Shyam

@Shyam_Pragash , I think we can manage with For Each Row, However we would require to know what are the Columns that need to be Updated.

If it is really required, we could go for a Linq Approach.

Hi @supermanPunch

I think Linq Approach is Best… Because i have many row and columns only daily bases. i have to regenerate it… i want to complete the work easy to fast way…

Thanks
Shyam

@Shyam_Pragash ,

We would still require to know what are the Columns to be Updated and what Columns are to be left as it is.

Hi @supermanPunch

These Columns only Update
image

Other Columns and its Values remain Same…

Thanks
Shyam

@Shyam_Pragash ,

Check the Updated Workflow Below which follows a Linq Approach :
DT_ConditionUpdate_Rows.zip (3.6 KB)

Also, there is a commented activity part which uses the For Each Row method. You could Check which will work better for your Large Data and use it accordingly.

1 Like

Hi @supermanPunch

Thanks You :slight_smile:

I need one more Correction.

image

Target Hrs colunms convert to time format “07:00:00

Do You have Any Study Material for Linq Uipath (Special for Uipath)?

Thanks
Shyam

@Shyam_Pragash ,

Check the Updated workflow below :
DT_ConditionUpdate_Rows.zip (3.8 KB)

For More On Linq, Check Below :

Performing hands on work on these Categories would help you to explore more about Linq, It’s uses, When to use and when it can be helpful.

1 Like

Hi @supermanPunch

Thanks You…

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.