Filtering Data in Uipath studio

Greetings

Can you guys assist me in filtering the data i want to be extracted in a table. I have a table with two columns (Document & Printing Time) In the Document Column i want to output only the Document Name that start with “HC-AG” and in Printing Time i want to change this date format e.g “Jun 11, 2019 4:03:06 PM” to “2019-06-11 4:03:06”. Your response will be highly appreciated. Y

Hi @BigDee
Welcome to uipath community buddy
–First lets filter the datatable with the column Document using filter datatable activity
where you can mention the input datatable of your extracted datatable and the column name between quotes like “Document” and use the condition as CONTAINS and the value as “HC-AG”
and we can get the output datatable of name out_dt, a variable of type datatable
–now once after the getting the output filtered datatable named out_dt from the filter datatable activity use a for each row loop and pass the variable out_dt as input
–inside the for each row loop use a assign activity like this
row(“Printing Time”) = Datetime.ParseExact(row(“Printing Time”).ToString,“MMM dd, yyyy”, System.Globalization.CultureInfo.InvariantCulture).ToString(“yyyy-MM-dd hh:mm:ss”)

thats all buddy you are done
Kindly try this and let know for any queries and clarification
Cheers @BigDee

1 Like

Did that work buddy @BigDee

@BigDee - Use Starts With here instead of Contains. As you have mentioned you wanted to filter the Policy starts with. Hence use Starts With.

Thanks,
AK

Thank you for response @Palaniyappan AND @AnandKumar26 . Please bear with me i’m still a rookie, but with your help i strongly believe that i’ll be fine. I don’t know how or where to put the for each loop can you please elaborate on that. which button to click in order for arrive there after putting out_dt as an Output datatable( it says " value for a required activity argument is not supplied ‘Datatable’ was not supplied")

Fine can i have a screenshot of your xaml , the workflow been made so far if possible
or if not let us know we would send you a xaml buddy
Cheers @BigDee

@Palaniyappan Thank you for your response here’s the screen shot of the workflow i’ve made so far.

1 Like

Fantastic you were almost done… @BigDee
we need to mention this buddy
input datatable
pass the output variable from previous activity extract structured data ‘Table’ as input to this filter datatable activity
image
once after this kindly share the screenshot of filterwizard once buddy
Cheers @BigDee

Thank You for patience @Palaniyappan

which output variable should i pass from this activity.

kindly pass the out_dt variable as input to filter datatable @BigDee
and can i have a view on this once if possible
image

1 Like

Done! now how do i implement the for each loop and assign this activity
row(“Printing Time”) = Datetime.ParseExact(row(“Printing Time”).ToString,“MMM dd, yyyy”, System.Globalization.CultureInfo.InvariantCulture).ToString(“yyyy-MM-dd hh:mm:ss”)

You’re a life saver @Palaniyappan

1 Like

both contains and starts with works the same buddy
only thing it makes difference is contains doesnt bother whether it is in first or last or middle, but will check all the occurence, thats why i mentioned that
whille starts with will check only the starting part of the string
Cheers @BigDee

well the out_dt is the variable that we pass to filter datatable activity, so we need to get the output from the filter datatable activity with a different output variable name of type datatable
create a variable named final_dt in the variable panel and mention the default value as new system.data.datatable
and mention this as output in the property of filter datatable activity

–Then after this use a for each row loop next to this filter datatable activity and pass the input as final_dt
–inside the for each row loop use a assign activity
like this
row(“Printing Time”) = Datetime.ParseExact(row(“Printing Time”).ToString,“MMM dd, yyyy”, System.Globalization.CultureInfo.InvariantCulture).ToString(“yyyy-MM-dd hh:mm:ss”)

Kindly try this and let know for any queries
Cheers @BigDee

Ow yeah thanks for elaborating on that buddy. @Palaniyappan .

Cheers
@BigDee

@Palaniyappan buddy i can tell that we almost done. Thing is i’m struggling to implement the for each loop. I do not know how to put it next to the filter database activity. Please bear with me.

we have an activity called for each row activity @BigDee

1 Like

:grinning::smiley::smile: @Palaniyappan Wow!!! You made my day thank You buddy.

can i output this as a CSV file. Like Put Write CSV after the for each loop for data to be extracted as a CSV format.

Fantastic
yes of course
pass the input as final_dt to the write csv activity we will getting a output with csv format
Cheers @BigDee

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)