# Request your help

**URL:** <https://forum.ansible.com/t/request-your-help/30215>\
**Category:** Ansible Project\
**Created:** [April 29, 2019, 7:10pm UTC](https://forum.ansible.com/t/request-your-help/30215 "2019-04-29T19:10:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vino\_B](https://avatars.discourse-cdn.com/v4/letter/v/839c29/32.png) [@Vino\_B](https://forum.ansible.com/u/Vino_B)\
**Post date:** [April 29, 2019, 7:10pm UTC](https://forum.ansible.com/t/request-your-help/30215/1 "2019-04-29T19:10:20Z")

</div>

Hi All,

I am trying to store the output of the ansible task into MySQL database, at present i am able to store the output of the task which does not contain with\_items , but not able to store the data for the task which contains with\_item, I used the below method, and i am getting the below warnings and the output is “None”. “updateLog” is a function which is used to update the output into the database

def v2\_runner\_item\_on\_ok(self, result):  
okStatus = True  
updateLog(result, okStatus)  
pass

[WARNING]: Failure using method (v2\_runner\_item\_on\_ok) in callback plugin (\<ansible.plugins.callback./Playbooks/TEST/db.CallbackModule object at 0x7fa4a3631cf8\>): expected string or bytes-like object

From,  
Vino.B

---

<div class="post-metadata">

**Author:** ![Matthew\_Davis](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@Matthew\_Davis](https://forum.ansible.com/u/Matthew_Davis)\
**Post date:** [May 8, 2019, 12:38am UTC](https://forum.ansible.com/t/request-your-help/30215/2 "2019-05-08T00:38:06Z")

</div>

When you use with\_items, the result is a list of results. So you will need to call updateLog for each item in the list.

What does updateLog do?  
It’s probably trying to access a particular attribute. Just check whether that attribute is a list or string. If it is a list, call updateLog on each item in the list.

Regards,  
Matt
