Data Manipulation with &
Posted: January 31st, 2023, 2:15 pm
I am working on a customers address import and some of the names come through from JDE with the & symbol converted to &
Currently, my workaround is to use the replace function to target any '&' and change them to AND because it's unable to handle being changed to &.Shown below: This works to change it into something that doesn't make the ConvertNodesValueToXml service throw an error. But I want the data to be inserted into the our table with the & symbol just as it is coming through from JDE. So then when I go to do the insert/upsert I use a replace again to target any of this data with AND and swap it back to & when it's entered into the database. All of this gets me the result that I want in the end but I'm wondering if there is a better way to do this or if this is the only way to handle a situation like this?
Later I need to do some manual node creation using this converted data. So I do that and use the ConvertNodesValueToXml service to convert these into actual Xml. This works fine except for when the data in one of these nodes contains the & and then I get an error from the ConvertNodesValueToXml service. Currently, my workaround is to use the replace function to target any '&' and change them to AND because it's unable to handle being changed to &.Shown below: This works to change it into something that doesn't make the ConvertNodesValueToXml service throw an error. But I want the data to be inserted into the our table with the & symbol just as it is coming through from JDE. So then when I go to do the insert/upsert I use a replace again to target any of this data with AND and swap it back to & when it's entered into the database. All of this gets me the result that I want in the end but I'm wondering if there is a better way to do this or if this is the only way to handle a situation like this?