Frequent errors when editing a formula inside a For Each activity

Hello,

I have often encountered this error whenever I am attempting to modify a formula inside a For Loop of different types, in this case JToken.

When I edit the List of items the For Each activities triplicate in the squence and cause the errors mentioned below.

The formulae that I am using are something along the lines of json_array_tenant_data(0)(“data”).AsEnumerable().Where(Function (x) x(“name”).ToString.ToLower.Contains(“randomname”) or x(“name”).ToString.ToLower.Contains(“otherrandomname”))

I am using Windows Legacy REFramework, Studio version 2022.4.6


for a further analysis it would be usefull to have more details (e.g. XAML) and the JSON as Textfile

Also important is the Version of the UiPath.System.Activities. Which one is used?

It looks a little bit like the sometimes encountered buggy feature that a for each is duplicated when it gets edited.

If so, then remove the unneeded duplicated for each activities again

UiPath.System.Activities version is 22.4.5. I apologize but I won’t be able to provide the json response. I have tested those queries individually and they should work fine. I also don’t believe it’s a JSON issue as I have encountered this issue when running other enumerable types in the For Each activity as well.

Yes lets focus on the buggy for each beahviour.

  • Take Backup from Studio Development Project
  • delete unneeded for eachs
  • Upgrade UiPath.System.activities to a newer Version but stay at 22.4.X Level (try 22.10 Level when needed, no Jump to 23.X Level)
  • Check and optional delete and remodell the remaining needed for each

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

Thank you, the link was very helpful. I was attempting to delete the extra For Each activities but they wouldn’t go away, which prompted me to create this topic.

Whenever I would attempt to modify the TypeArgument of these buggy activities, they would blank out and erase everything inside, including text fields.

What I ended up doing to recover from this was to Undo actions up until the bug occured. Set the TypeArgument to Object, made the necessary adjustments to the List of items formula and then switched the TypeArgument back to JToken.

Everything is back to normal for now. I mainly wanted to highlight this issue and check whether it was a common occurrence as it was not my first time running into it.

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