This looks less like a Power Fx issue and more like a prompt/LLM consistency issue caused by relying on the model to parse a date from free text.
A few things I would check:
-
Normalize the input before the prompt
The value is coming as:
name_table (from may/2000)
I would test whether casing or language/culture is affecting extraction. For example, try normalizing the table name before sending it to the prompt:
name_table (from May/2000)
or even better, convert the month text to a numeric value before the AI step if possible.
-
Avoid using AI for deterministic date parsing
Since this is a structured pattern, I would avoid asking the prompt to extract May/2000 and convert it to 200005. That logic is deterministic and better handled in Power Automate or Power Fx using string functions, regex-like parsing, or a mapping table for month names.
For example, if the table name always contains a pattern like:
from May/2000
then the flow can extract:
-
Month = May
-
Year = 2000
-
Convert Month to 05
-
Build 200005
This will be more reliable than depending on the prompt.
-
Check whether the issue is tied to the record, not the pattern
Since other tables with the same pattern work, I would compare the exact string for ID 3065 against a working table name. Look for hidden characters, extra spaces, non-breaking spaces, encoding issues, or a lowercase month value. Sometimes the visible text looks identical, but the underlying string is slightly different.
-
Add a fallback rule in the prompt
You can also make the prompt stricter:
“If the table name contains from <month>/<year>, always return InitialDate as YYYYMM. If there is no end date, use the provided current date as finalDate. Never return InitialDate as blank when a valid month/year is present.”
-
Log the exact input passed into the failing prompt
Since the same prompt works directly in Power Automate but fails in the Copilot flow context, I would capture the exact runtime input immediately before the AI prompt step. The issue may be that Copilot is passing a slightly different string or object than the one tested manually.
My recommendation would be: use the prompt only to identify the relevant table if needed, but move date extraction/conversion into deterministic flow logic. Date parsing is one of those areas where traditional logic will be more reliable than an AI prompt, especially when the output is later used by Power Fx to make a decision.