BC30574: Option strict on - Binding error (for each)

I have implemented a for each activity to iterate through a JObject (Deserializes JSON).
At that point, I do not get any errors.

Within the “for each activity” I have a second Orchestrator https request and deserialize another JSON with another “for each activity” iterating though a different JObject.

Within that “for each activity” there is an error: BC30574 option strict on binding error.

How can I resolve that? Actually, I am doing the same thing in that for each activity, which is why I don’t understand why it should fail.


image

Hi @PeCour

Can you check the TypeArgument of the For Each?

Thanks,
Srini

@PeCour

newtonsoft.json.linq.jtoken should be the type of argument for for each activity

@Shiva_Nikhil, @Srini84 thank you for your help.

The type is: “Newtonsoft.Json.Linq.JObject”. In both cases. In the first for each, it works in the second, it does not work.

Further, in modern activities, it is not possible to change the type manually.

@PeCour

can you share the image of the assign at which the error is showing

Thanks

@Shiva_Nikhil the image of the assign activity is in the intial post (in the middle).

Formula: "currentItem(“Message”).ToString

@Shiva_Nikhil / @Srini84 I copied the for each from a different .xaml file while presetting the List of the Elements with the same variable name that i am using in the second for each.

Magic: It works and the error is not there anymore. Although, everything is the same.

I think it is a UiPath bug.

@PeCour

Hope you got the answer solved

Thanks and Happy Automation

1 Like
1 Like

@ppr thank you for the overview. But for me forcing the TypeArgument does not work. I get the same error message.

And the “workaround” I mentioned above also only works from time to time.

what was done, how are the details from the JSON (when working, when failing)?

It is quite random.

In one project it works like in the screenshot below or also like that out_Test(“value”).values(of JObject). But if I change the variable, it might not work again.

image

But then in a different project, it does not work at all. If I copy the for each from one project to the other where it was not working then it is working.

image

It is quite a mess. I also tried different versions of packages (no difference).

more a hint that different structures are involved

However it is highly recommended to force it espeacially when working for each of newer versions. Sometimes it is hanging in the retrieval calculation. So delete and retype is doing a forcing

@ppr I deleted it again and did as you said and it worked as well.
So, I hope it stays like that.

Thank you for your help.

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