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
7 replies
Subscribers
6 subscribers
Views
6410 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Process
Appned single quotes('') to the cdt value
nikitar890
Certified Associate Developer
over 8 years ago
I have a process where I get data from data base, I want all the values in the database to be between single quotes(''). Eg:- cdt:{name:xyz,phone:12345}, I want it to be {name:'xyz',phone:'12345'}. Instead of mapping it filed by field, Is there a way that I pass the cdt and all the values in the CDT get inserted between '' ?
Thanks in Advance,
Nikita.
OriginalPostID-268937
Discussion posts and replies are publicly visible
0
reginaldm377
over 8 years ago
Hi Nikita, could you elaborate on the use case for wanting this?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Durgesh
A Score Level 2
over 8 years ago
AFAIK, There is no in-built function to append single quotes for all the CDT parameters. You can create one expression rule & pass CDT value as a input. In the rule, you can apply logic of appending single quotes to all the parameters. then return the CDT (You have to explicitly cast it to CDT Type while returning) to the caller. This expression rule you can call in apply() function for CDT array (for all the rows of a database). You need to make sure that if there are different data type CDT parameters then cast them to string before appending the single quotes. You can try this and let us know if that works for you.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aloks0189
Certified Lead Developer
over 8 years ago
@nikitar890 I don't understand how you got such requirement, but if this is the case then create an expression rule and have a rule input of type CDT or Any Type and form a Dynamic CDT where append single quote before and after the data for each property of CDT , so once you get the CDT having single quotes, you can do whatever you requirement is.
I hope this will help you to proceed further. But still i am in confusion, why do you want such behavio/functionality
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
nikitar890
Certified Associate Developer
over 8 years ago
@Aloks176: I am generating a document using the dynamic document template. So to build the XML the values should be in quotes. I have more than 30 CDT's from which I need to get the values so I am trying to make it dynamic. I have completed the building the expression for XML except that the values should be in single quotes.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aloks0189
Certified Lead Developer
over 8 years ago
@nikitar890 in such case i suggest you, can go for Dynamic CDT preparation as suggested by me as well as @durgeshk
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 8 years ago
Not sure if this helps but I had something similar and adapted it. The attached expression returns an array of the values in a given CDT, with each value between single quotes. To be honest I'm with aloks176 on this one - not sure why the values need to be in quotes as that's not usually a requirement for XML. Anyway, maybe the attached will help.
e-268937.sail
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 8 years ago
PS - obviously replace the CDT type with one of your own.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel