How to include a dictionary into another

Hello,

I have to make a JsonString which looks like:

{
“email”: “lucy.bot.webhelp@gmail.com”, //should be same for the sandbox
“quantity”: 1,
“custom_fields”: {
“subject”: “test”,
“description”: “test”,
“what_do_you_want_to_achieve”: “test”,
“when_do_you_expect_this_service_to_be_delivered_from_it”: “2022-12-14T10:32:34Z”,
“wh_region”: “UK”,
“wh_site”: “INDIA GURGAON”,
“wh_project”: “IT”
}
}

For each keys and values I have made string-variables.
As you can see there is a dictionary which contains 2 object and another dictionary.

I used an assign:

dictCF = New Dictionary(Of String, String) From {{ strKeySubject, strSubject},{ strKeyDescr, strDescr},{ strKeyAchieve, strAchieve},{ strKeyDate, strDate},{ strKeyRegion, strRegion},{ strKeySite, strSite},{ strKeyProject, strProject}}

Now I would like to include dictCF into dictTotal which also contains the objects “email” (strKeyEmail,strEmail) and “quantity” (strKeyQuantity,strQuantity).
I know that there a more topics about this, but none had the answer for me.
Who can help me out?
Many thanks in advance!

we would suggest to more clear seperate the both worlds, usage of terms and clear seperation of what is the final target / goal to achieve.

The targeted output we do understand:

Her we do see a JSON. A JObject with three Properties: email, quantity, custom_fields. The value of the custom_fields is again a JObject

The way / strategy to create the above JSON was selected by you to create it with nested dictionary.

As far we have understood,have a look here:

dictCF
grafik

dictTotal:
grafik

Assign Activity:
dictTotal(“custom_fields”) = dictCF
grafik

And finally we bring it to JSON:
grafik

it looks close to your above mentioned json
Kindly note: the double quotes is the visuallzation of inner double quotes and not part of the string.

Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum

That helps!! Thank you very much!!
You’re my hero of today!

Perfect, Just do the final testing and when it is done please close the topic by:
Forum FAQ - How to mark a post as a solution - News / Tutorials - UiPath Community Forum

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