Appned single quotes('') to the cdt value

Certified Associate Developer
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

Parents
  • 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.
Reply
  • 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.
Children
No Data