- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
10-13-2024 03:48 AM
Hi all 😀
I have a table of data in Cortex XSOAR (e.g., a list of dictionaries with results from a query), and I need to rename one of the column headers before processing it further in my playbook.
For example, I want to rename the column oldName
to newName
. How can I achieve this either within a script, automation, or as part of a playbook task?
If there are any best practices or recommended approaches for handling this kind of column renaming, I'd appreciate the guidance!
Thanks!
10-16-2024 08:07 PM
Hi @nivnetanel96, this is the simplest way I can think of without modifying the context.
Example using the File key. Table below showing the original value of the key as a table.
Same ToTable function with a bunch of transformers applied.
The output should looks like below.
There are other methods but they require some programming knowledge and modification of the CommonServerUserPython script. You can check the pascalToSpace function inside CommonServerPython as an example.
Thanks,
Jeremy.
10-15-2024 11:25 AM
@nivnetanel96 Are these table headers the keys of list of dictionaries you are getting back in response to your query? So when you say you want to change the header value do mean that you want to change one of the dict keys so that when you display them in a table the header is changed?
10-16-2024 08:07 PM
Hi @nivnetanel96, this is the simplest way I can think of without modifying the context.
Example using the File key. Table below showing the original value of the key as a table.
Same ToTable function with a bunch of transformers applied.
The output should looks like below.
There are other methods but they require some programming knowledge and modification of the CommonServerUserPython script. You can check the pascalToSpace function inside CommonServerPython as an example.
Thanks,
Jeremy.
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!