Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
2 replies
Subscribers
8 subscribers
Views
6049 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
I'm using "updatecdt" to update a value in the CDT as follows,
Vinod Bongoni
Certified Lead Developer
over 9 years ago
I'm using "updatecdt" to update a value in the CDT as follows,
updatecdt(ac!test,{rndTest2:{rndTest1:{id:333}}})
In this, I need to construct dictionary for second parameter dynamically. I have only field names like {"rndTest2","rndTest1","id"} and value is 333. So I managed it to construct with text type. I tried to pass as a text type then it is throwing an error like "Invalid dictionary". So How can we cast text to dictionary type or any other possible way to pass 2nd parameter. Please suggest me.
Thanks.
OriginalPostID-169098
OriginalPostID-169098
Discussion posts and replies are publicly visible
0
Mike Schmitt
Certified Lead Developer
over 9 years ago
I'm not sure without a little more context first, but updateCdt might require you to first initialize the variable you're updating with a CDT (dictionary) value with at least the structure in place.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Vinod Bongoni
Certified Lead Developer
over 9 years ago
Hi mschmitt,
Thank you for your response.
The first parameter "ac!test" is a CDT type("rndTest3", Please find attached CDT structure) and it was initialized with data. My concern about second parameter.
We need to pass only dictionary type so I need to construct dictionary like "{rndTest2:{rndTest1:{id:333}}}" with field names and values. So my question is that how to construct dictionary like {rndTest2:{rndTest1:{id:333}}} dynamically. I have only field names like {"rndTest2","rndTest1","id"} and value is 333. By using these field names and values I need to construct like {rndTest2:{rndTest1:{id:333}}}, which should be a dictionary type.
Somehow I managed to construct "{rndTest2:{rndTest1:{id:333}}}" in text type but I need it in the dictionary type only because "updatecdt" will accept only dictionary type as second parameter. I am able to construct like "updatecdt(ac!test,"{rndTest2:{rndTest1:{id:333}}}")" but it's throwing error that "Invalid dictionary". So we should pass only dictionary type as second parameter.
Please suggest me, how to construct dictionary type(second parameter as below) by using field names like {"rndTest2","rndTest1","id"} and value is 333?
updatecdt(ac!test,{rndTest2:{rndTest1:{id:333}}}).
Thanks.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel