For each activity property missing

Hi,

I want to change type argument of Object to datatable but there is no option showing in studio. Can anyone help me to change argument type.

Property section is missing for - FOR EACH activity.

1 Like

In latest vesion,We heard that For Each Activity has no TypeArgument Property and it will Automatically Pick TypeArgument. But sometimes it is not working as we excpect. Then, what is the Solution ?

๐’๐จ๐ฅ๐ฎ๐ญ๐ข๐จ๐ง :
๐‚๐š๐ฌ๐ž ๐Ÿ : CType(Value_Object,Target_Datatype)

๐‚๐š๐ฌ๐ž ๐Ÿ : DirectCast(Value_Object,Target_Datatype)

For Clear Information, You can see the below image.

or downgrade the version

Hi

With modern activities we donโ€™t need to mention
Just the value of list of items field must be a collection of homogenous object
It will pick things automatically

Only if you are using windows legacy project we get that option of mentioning the TYPE ARGUMENT

Check with the example from UiPath docs as below
https://docs.uipath.com/activities/other/latest/workflow/for-each#example-of-using-the-for-each-activity

Cheers @Jeeru_venkat_Rao

I have dataset datatype and want to convert it into datatable. I tried your method but not working. Can you share it if possible.

I want to write data into excel.

As a workaround, can you try to downgrade UiPath.System.Activities package to 22.10

you will get collection of data tables by using above method

Do one thing take assign activity inside for each
left side
take a variable of data table
right side
Directcast(currentitem,system.data.datatable)
then use write range and give the data table variable

Hope this helps

Hi @Jeeru_venkat_Rao

The For each property of Type argument is in the older versions of the For each activity.
If you want to make sure to use the Type argument in the properties of for each.
Then downgrade the version of UiPath.System.Activities package. Then only you can find the Type argument option in properties.

Note - By Downgrading the package it will effect the activities which are in the UiPath.System.activites package.

Hope it helps!!

:ambulance: :sos: [FirstAid] For Each Activity - Forcing TypeArgument - News / Vote on Tutorials - UiPath Community Forum

myDataSet.Tables.Cast(Of DataTable)

as mentioned above in the first aid. You can stay with your origin package version when applying this forcement / helper

Thank you @Usha_Jyothi .
Its workingโ€ฆ

Happy automation
Usha

Thank you PPR & Mahesh for your help.

You donโ€™t do the DirectCast in an Assign. You do it in the For Each activityโ€™s โ€œList of itemsโ€

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