100981
(100981)
January 25, 2023, 1:55pm
1
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!
ppr
(Peter Preuss)
January 25, 2023, 2:29pm
2
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:
100981:
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”
}
}
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
dictTotal:
Assign Activity:
dictTotal(“custom_fields”) = dictCF
And finally we bring it to JSON:
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
100981
(100981)
January 25, 2023, 4:28pm
3
That helps!! Thank you very much!!
You’re my hero of today!
ppr
(Peter Preuss)
January 25, 2023, 4:30pm
4
system
(system)
Closed
February 2, 2023, 3:10pm
5
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.