web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Filter Array fails in ...
Copilot Studio
Answered

Filter Array fails in Copilot Studios Work flow with Parse JSON output that works in Power Automate

(2) ShareShare
ReportReport
Posted on by 50
Description
Context: Workflow built inside a Copilot Studio agent, Filter array won't work (Power Automate works with the exact same inputs).
Chain: Power BI "Run a query against a dataset" -> Parse JSON -> Filter array.
 
What works:
"Run a query against a dataset" (Power BI connector) returns rows correctly, confirmed in the run history with real row data.
"Parse JSON" parses that output successfully (green checkmark, no schema errors).

What fails:
"Filter array," pointed at the parsed rows via the dynamic content picker, fails every run with:

The 'from' property value in the 'query' action inputs is of type 'Null'. The value must be an array.
Inspecting the "From" field shows the inserted expression as:
 
@body('Parse_JSON')?['results/tables/rows']
This treats results/tables/rows as one flattened string key rather than the correct chained path through two arrays:
@body('Parse_JSON')?['results']?[0]?['tables']?[0]?['rows']

Since no property literally named with slashes exists on the object, this evaluates to null, hence the error.

Confirmed environment-specific: building the identical chain (same dataset query, same Parse JSON schema, same Filter array condition) in a classic Power Automate cloud flow at make.powerautomate.com works correctly, "From" resolves to the rows array and the filter runs as expected. Only the embedded Copilot Studio canvas produces the broken flattened reference.
 
Question?: Is this a known issue with how the embedded flow canvas resolves/inserts references to nested arrays (two levels deep: array of objects containing another array of objects)? Is there a possible fix to this problem?

Kind regards: Vektori
wf.png
pa.png
I have the same question (0)
  • Verified answer
    Haque Profile Picture
    3,791 on at
     
     
    @body('Parse_JSON')?['results/tables/rows']
    This treats results/tables/rows as one flattened string key rather than the correct chained path through two arrays:
    @body('Parse_JSON')?['results']?[0]?['tables']?[0]?['rows']
     
    You written expression treats 'results/tables/rows' as a single key, which is not exist and returns null.
     
    The correct expression should be navigaate the nested arrays and objects explicitly:
    @body('Parse_JSON')?['results]?[0]?['tables']?[0]?['rows'] - access first element of result array, then first element of tables array and finally the rows arry.
     
    XPath is your friend in this case - if want to spend times please watch this video.
     
     

    I am sure some clues I tried to give. If these clues help to resolve the issue brought you by here, please don't forget to check the box Does this answer your question? At the same time, I am pretty sure you have liked the response!
  • Suggested answer
    Valantis Profile Picture
    6,857 on at
     
    Your diagnosis is exactly right. The Copilot Studio Workflow canvas flattens nested array paths in the dynamic content picker instead of generating the correct chained index notation. This is a confirmed behavior difference from the full Power Automate canvas.

    Fix: don't use the dynamic content picker for the Filter array From field. Switch to expression mode manually and type:
    body('Parse_JSON')?['results']?[0]?['tables']?[0]?['rows']

    In the Filter array action, click the From field, then switch to the expression tab (or edit in advanced mode) and enter the expression above directly instead of selecting from the picker.

    This bypasses the flattened path issue entirely since you're providing the correct path yourself. The Workflows canvas will accept a manually typed expression even when its picker generates a broken one.
     
      Best regards,

    Valantis   ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/ 💼 LinkedIn ▶️ YouTube
  • Vektori1 Profile Picture
    50 on at
    Thanks for both answers. I used the “Select” data operation and then “Filter array,” as explained in @Haque’s video, and it works.

    - Vektori
  • Haque Profile Picture
    3,791 on at
     
    Thanks for letting us know you got the solution. Just, out of curiosity, can you please check if this expression "@body('Parse_JSON')?['results/tables/rows']"  works in Power Autamte? All data operation that needed inner level value, I am used to with nested navigation of each layer with null (?) check. But slash(/) based navigation is bit of new for me.
     
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
11manish Profile Picture

11manish 227

#2
sannavajjala87 Profile Picture

sannavajjala87 208 Super User 2026 Season 1

#3
Valantis Profile Picture

Valantis 198

Last 30 days Overall leaderboard