For each activity can change type argument

Hello, can anybody tell me why can’t I change Type argument from object to Element.
I am using Studio 2023.6.1.

This was easy in older versions

@tomaz In latest version we can’t change argument type of For Each Activity. It has telesense when you put variable it will automatically select suitable argument type.

Doesn’t work for me when I input deserialesed XML.

@tomaz This case is Already highlighted from many users.
Currently if you want to select argument manually then you can downgrade your package and you can use it.

@tomaz can you show us what is the Exact Error.

For Each: Object reference not set to an instance of an object.

@tomaz I believe it is not issue of for each loop argument.

Did you try to run it in Debug mode to find out exact place of error?

The error message “Object reference not set to an instance of an object” in the context of a foreach loop typically means that the collection or enumerable you’re trying to iterate over is null or hasn’t been initialized.

To ensure this thing place if condition and put loop inisde it.

Are you sure your collection which you want to iterate is not Empty?


Show me For Each Expression. I want to see what you want to iterate.

@tomaz can you show me file that part which you want to iterate. Did you check this expression outside loop by putting in log message what is the output of this expression.

Camt53_10100-0050572012_20230630-114.xml (434 Bytes)
Same error

This is a horrible change to this activity. Let UiPath know by voting here.

This means DeserializedXML is not initialized and has no value.

There was something wrong with XML

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