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
9 subscribers
Views
2141 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
Is there a way to persist a Dictionary/CDT variable to a database and get later read it back out?
briank538
over 8 years ago
In Appian, is there a way to take a Dictionary or even a CDT variable, persist that out to a database and then read it back to a variable?
For example, I would like to take something like {new: 5, mod: 1, retire: 0, os: "Windows"} and write that to a VARCHAR column in a database. I would actually like to see the text written out to the DB field as "{new: 5, mod: 1, retire: 0, os: "Windows"}" so it's human readable.
Then I would like to read it back into a variable, perhaps of Any Type, for this example local!project and the be able to reference local!project.new directly.
Is this possible? This would be an awesome feature if it can.
Thanks.
OriginalPostID-237629
Discussion posts and replies are publicly visible
0
Mike Schmitt
Certified Lead Developer
over 8 years ago
You're in luck!
Basically what you do is use a!toJson to convert your dictionary to a string, then send that into the DB. Later when you read it back out, use a!fromJson to convert it back from string to a useable cdt-style dictionary.
forum.appian.com/.../System_Functions.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
briank538
over 8 years ago
Awesome. Works like a charm. Thank you.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel