- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
07-19-2023 11:21 PM
Hello,
I'm trying to create a dataframe from two lists from the context:
key1:
0:value1
1:null
2:value3
key2:
0:value1
1:value2
2:value3
When I call them using demisto.getContext(...), the null value is not passed, like if the key doesn't exist.
So my first list becomes, without a row:
key1:
0:value1
1:value3
How can I make XSOAR to detect this Null value, which appears in the context interface?
07-20-2023 12:39 AM - edited 07-20-2023 12:40 AM
Hi @Josep ,
I tried to reproduce what you explained but I could not see the same results. Can you explain which commands do you use to create those lists and where do you see that list without a null value?
What I have done is as below:
1. Created a list with a null value:
07-20-2023 01:52 AM
It's working for you😲. These nulls values are brought at the beginning when the incident is created. In my case, when I call the variable ${incident.test1} the null indexes are deleted:
test1:
0:1
1:3
I'm using it directly at a playbook, not in an automation
07-21-2023 10:47 AM
I just tested as well, I created an incident with a field testnull and set a list with a null value for that field:
Then I ran a task in a playbook that set the context key test with the data from the testnull field:
That new test context key still contained the null value:
08-08-2023 02:39 AM
Sorry for replying so late. The "null" value used is not a string @amontminy, example:
When this null value is used directly in a task conditional it doesn't detects it as an empty value. How can I check if this value is null?
08-08-2023 03:58 AM
But I would like to check if a list of dicts has a null value. If I do the oposite, "doesn't equal" it will give me the ones that have value. I just want to check if one of them is "null".
08-08-2023 06:22 AM
Strange, It works for me. I put a condition and tested it with different cases. If I set another field with stringifyArray Transform, the null values are not stripped from the list.
08-09-2023 05:59 AM
Thanks for your help,
I don't know if it could be a server configuration which treats the null values differently.
The data used is the output of an xdr incident, the initial data fetched.
10-12-2023 02:01 AM
Stuff under "incident" in the context is actually an incident field and not part of the context. Instead of using demisto.getContext what do you get if you use demisto.incidents() instead?
For the conditional, I am guessing you're going to want something like: filter by Not Defined + Count transformer, then in the condition check if the result is >= 0
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!