- Community Home
- >
- Software
- >
- HPE Morpheus Software
- >
- HPE Morpheus Enterprise
- >
- Getting Task Result in Python
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 08:21 AM
02-16-2024 08:21 AM
What am I doing wrong here?
Result from task:
{‘sys_id’: ‘test123’, ‘number’: ‘123’}
Output:
{“pythonResultTest”: {}, “lastResult”: {}, “resultList”: [{}]}
Morpheus Version: v6.2.6
Thanks!
Solved! Go to Solution.
- Tags:
- Tasks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 08:53 AM
02-16-2024 08:53 AM
Re: Getting Task Result in Python
Use json.dumps in the first task too, or output as single value rather than JSON. That should give you output.
I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 09:02 AM
02-16-2024 09:02 AM
Re: Getting Task Result in Python
Thank you! json.dumps() is the key.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 08:45 AM
02-16-2024 08:45 AM
SolutionThe first task should be
json_string = {"sys_id": "test123", "number": "123"} print(json.dumps(json_string))
and second task to print the result should be
print(json.dumps(morpheus['results']['taskone']))
where taskone is the code of the first task.