# M5\_UGL\_1\_R - Plan execution - Extracted Answer shows: None

**URL:** <https://community.deeplearning.ai/t/m5-ugl-1-r-plan-execution-extracted-answer-shows-none/881737>\
**Category:** Agentic AI\
**Tags:** week-module-5, course\
**Created:** [October 19, 2025, 10:42am UTC](https://community.deeplearning.ai/t/m5-ugl-1-r-plan-execution-extracted-answer-shows-none/881737 "2025-10-19T10:42:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![webermac](https://avatars.discourse-cdn.com/v4/letter/w/b19c9b/32.png) [@webermac](https://community.deeplearning.ai/u/webermac)\
**Post date:** [October 19, 2025, 10:42am UTC](https://community.deeplearning.ai/t/m5-ugl-1-r-plan-execution-extracted-answer-shows-none/881737/1 "2025-10-19T10:42:57Z")

</div>

Hello, the extracted answer output shows NONE. I have checked all all variables. The generated Python code creates the right answer. Does anyone have the same effect?

Thanks in advance!

Martin

---

<div class="post-metadata">

**Author:** ![Athul2](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/athul2/32/22233_2.png) [@Athul2](https://community.deeplearning.ai/u/Athul2)\
**Post date:** [October 20, 2025, 2:21pm UTC](https://community.deeplearning.ai/t/m5-ugl-1-r-plan-execution-extracted-answer-shows-none/881737/2 "2025-10-20T14:21:50Z")

</div>

Can you try printing the “result” instead of “result[“answer”]“ and check whether the agent is working correctly? if not could you share what the “result“ prints?

---

<div class="post-metadata">

**Author:** ![samraul](https://avatars.discourse-cdn.com/v4/letter/s/9fc29f/32.png) [@samraul](https://community.deeplearning.ai/u/samraul)\
**Post date:** [October 24, 2025, 10:53pm UTC](https://community.deeplearning.ai/t/m5-ugl-1-r-plan-execution-extracted-answer-shows-none/881737/3 "2025-10-24T22:53:24Z")

</div>

I had the same problem. The issue seems to come from the fact that the agent generates wrong python code:

```python
cond = (
    (S.quantity_in_stock > 0) &
    (S.price < price_limit) &
    (S.description.test(lambda desc: shape_keyword in desc.lower(), desc))
)

```

This line is not correct:

```python
(S.description.test(lambda desc: shape_keyword in desc.lower(), desc))

```

In order to fix it, I modified the agent prompt, and added an instruction:

```auto
Constraints:
- Use TinyDB Query for filt...
- Keep code clear an...

# THIS IS THE NEW INSTRUCTION
- Make sure the Query syntax is correct, especially when invoking description.test

```

With that, the code generated is different:

```python
# Filter by style in description
if style_keyword:
    cond = Q.description.test(lambda desc, sk=style_keyword: sk in desc.lower())

```

And works as expected:

```auto
Plan Execution · Extracted Answer

Yes, we have our Classic round sunglasses in stock for $60.

```

Cheers

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [October 24, 2025, 11:47pm UTC](https://community.deeplearning.ai/t/m5-ugl-1-r-plan-execution-extracted-answer-shows-none/881737/4 "2025-10-24T23:47:29Z")

</div>

@lesly.zerna can you verify this finding?

---

<div class="post-metadata">

**Author:** ![webermac](https://avatars.discourse-cdn.com/v4/letter/w/b19c9b/32.png) [@webermac](https://community.deeplearning.ai/u/webermac)\
**Post date:** [October 27, 2025, 9:46am UTC](https://community.deeplearning.ai/t/m5-ugl-1-r-plan-execution-extracted-answer-shows-none/881737/5 "2025-10-27T09:46:02Z")

</div>

Thanks! I have rerun several times. Now it works.

Regards, Martin

---

<div class="post-metadata">

**Author:** ![lesly.zerna](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/lesly.zerna/32/47465_2.png) [@lesly.zerna](https://community.deeplearning.ai/u/lesly.zerna)\
**Post date:** [October 28, 2025, 9:38pm UTC](https://community.deeplearning.ai/t/m5-ugl-1-r-plan-execution-extracted-answer-shows-none/881737/6 "2025-10-28T21:38:18Z")

</div>

Thanks for reporting and thanks @TMosh for the support!

We’ll also double check with the team!
