customize widget from script

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

customize widget from script

L0 Member

Hi Team,

 

I have developed automation to get all the similar incident names with dictionary return results that have ID and incident name.

 

Once I call the script from the widget, pie, table, or any of them, I get the following error; anyone can help !!

 

bzahran_0-1669213017794.png

 

2 REPLIES 2

L1 Bithead

Hi, well I don't know how the script written, but you can use as an example the scripts in the "integrations and incident health check" pack.

In the pack, you have multiple example of how you should return the data for the widget (/dynamic sections).

L5 Sessionator

Hi @bzahran, I think it might be an issue with the structure of the results. Check the examples here - https://docs.paloaltonetworks.com/cortex/cortex-xsoar/6-9/cortex-xsoar-admin/widgets/create-a-custom....

 

I think to process most chart based results. It needs to be list of dictionaries. Like the example below.

 

data = [
    {"name": "2018-04-12", "data": [10]},
    {"name": "2018-04-10", "data": [3]},
    {"name": "2018-04-17", "data": [1]},
    {"name": "2018-04-16", "data": [34]},
    {"name": "2018-04-15", "data": [17]}
]
demisto.results(json.dumps(data))

 

  • 1317 Views
  • 2 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

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!