How to escape values containing commas within comma-delimited s.list vars | Community
Skip to main content
Level 2
September 11, 2023
Solved

How to escape values containing commas within comma-delimited s.list vars

  • September 11, 2023
  • 2 replies
  • 2046 views

We use commas as our delimiter in s.list vars. However I now have a situation where values being passed could potentially include commas in them.

How do I make sure that any commas appearing within values do not cause delimiting of the s.list value? Is it as simple as putting single or double quotes around values?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by leocwlau

Or you may go the the report suite admin and change the "value delimiter" from a comma to another character which you are certain will not be part of the data.

2 replies

Jennifer_Dungan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
September 12, 2023

I've not tried to escape characters before... I would have to try escaping to see if it works, but another option might be to replace commas that are part of the values with something else, or remove them? 

 

Possible processing each piece of data with a regex replace?

Level 2
September 12, 2023

Thanks Jennifer, good idea. This is probably what I'll end up doing if quotes don't work

Jennifer_Dungan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
September 12, 2023

I assume you have a dev / qa / testing suite of some sort. You can try some of the options there and see if anything works. The data should show up in about an hour... just keep track of what you tried and when.

leocwlau
Community Advisor and Adobe Champion
leocwlauCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
September 12, 2023

Or you may go the the report suite admin and change the "value delimiter" from a comma to another character which you are certain will not be part of the data.

Level 2
September 12, 2023

Thanks yes, I am thinking about that. The problem is we use the s.list vars for multiple things, basically anything we need to be able to collect multiple values in a single call for (I've configured each of the s.list vars for the three visit scopes). This means I need to go back through the code to find every instance of where we set s.list, and change any joins to use the correct delimiter.

 

I might still do this if I can't find another solution. 

Jennifer_Dungan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
September 12, 2023

Yes, this is a common issue... torn between changing the entire implementation or not...