Option Strict On disallows late binding with json files and foreach

I have two json file of configuration settings. The first json file is master ( or baseline), the second file is the latest export of the configurations settings. The files contain details of policies and if they are enabled or disabled.

There a over 100+ policies for each json file.

The requirement us to read the export json file and match the enabled state to master json file.

  1. I read the export json file applications policies
  2. Then application policy and for each policy loop the master json file.
  3. Compare export policy to master policy and set master policy value for disable/enable.

We only want to affect the policy settings only. This why don’t just replace export with master.

The problem occurs when looping through the two json files…

image

Why am I getting “Option Strict On disallows late binding”, how can I fix this or is there an alternative approach to merging two files.

ensure that the typeArgument of the foreach Activity is set right or force it:

Maybe you can share some sample data with us as the case has a potential to get it solved different

EDITED: fixed Typos

The templates are for production and non-production environments of our Oracle Enterprise Data Management. Each file is approx. 8Mb in size. Unfortunately I’m not allowed to share outside the bank.

You can find the public REST API docs here - REST API for Oracle Enterprise Data Management Cloud Service - About the REST APIs

Sample json template (edited)…

“applications”: [
{
“id”: “625c0eed-185d-436f-868f-018db5029703”,
“name”: “xxxxxxxxx”,
“description”: “xxxxxxxxxxxxx”,
“applicationTypeId”: “56be27ba-28e4-4b23-827d-bfe64833095c”,
“applicationAdapterId”: “cdace9aa-50dd-4dda-b4b7-8eddedd12fc3”,
“viewId”: “d50f945f-140d-46eb-993e-9a07ab4e1698”,
“policies”: [
{
“id”: “abeeaa6c-9576-43bd-a1b8-e8bcf3c71f5b”,
“name”: “Backstop”,
“description”: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
“policyType”: “APPROVAL”,
“allowedActions”: ,
“expressionDocument”: null,
“objectType”: “APPLICATION”,
“objectId”: “625c0eed-185d-436f-868f-018db5029703”,
“enabled”: false,
“allowAllActions”: true,
“invitees”: [
{
“userId”: null,
“groupId”: “61f483bf-e458-42c3-b5d9-441e908ab249”,
“order”: 0,
“approvalsRequiredPerGroup”: 0
}
],
“propertyFilterConfigurationType”: “ALL”,
“configuredProperties”: ,
“requestTypes”: [
“INTERACTIVE”,
“SUBSCRIPTION”,
“IMPORT”
],
“allowAllRequestTypes”: false,
“daysUntilOverdue”: 0,
“processingType”: “SERIAL”,
“allInviteesMustApprove”: true,
“numberOfApprovalsRequired”: 0,
“submitterAutoApproves”: false,
“reminderNotification”: 5,
“numberOfRemindersBeforeEscalation”: 0,
“allowEnrichment”: false,
“policyOrder”: 1,
“ownershipPropertyId”: null
},
{
“id”: “d867aff8-fd9d-4bf0-b6fc-5e16971854c1”,
“name”: “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”,
“description”: “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”,
“policyType”: “COMMIT”,
“allowedActions”: ,
“expressionDocument”: null,
“objectType”: “APPLICATION”,
“objectId”: “625c0eed-185d-436f-868f-018db5029703”,
“enabled”: false,
“allowAllActions”: true,
“invitees”: [
{
“userId”: null,
“groupId”: “6dba34a4-8fd6-400d-97c4-81705ce9c8d3”,
“order”: 0,
“approvalsRequiredPerGroup”: 0
}
],
“propertyFilterConfigurationType”: “ALL”,
“configuredProperties”: ,
“requestTypes”: ,
“allowAllRequestTypes”: true,
“processingType”: “PARALLEL”,
“allInviteesMustApprove”: false,
“numberOfApprovalsRequired”: 1,
“submitterAutoApproves”: false,
“reminderNotification”: 5,
“numberOfRemindersBeforeEscalation”: 0,
“daysUntilOverdue”: 0,
“policyOrder”: 1
},

we can only little derive from the snipper, but please confirm to us that all typearguments of all for each activities are checked and correctly set

we would assume in the majority that typeargument needs to be set to JObject

Your FirstAid fixed the initial post, by upgrading UiPath.System.Activities = 23.4.5 and checking all the types.

But now a previous “Deserialize JSON” is failing with the message “Deserialize JSON: Deserialized JSON type ‘Newtonsoft.Json.Linq.JValue’ is not compatible with expected type ‘Newtonsoft.Json.Linq.JObject’. Path ‘’, line 1, position 1.”

This was ok previous to update of UiPath.System.Activities.

we would use the Value(Of XXX) or Values(Of XXX) method and can avoid subsequent deserialization needs

All good thank for you help.

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