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 / Power Automate / Polymorphic Lookup Fie...
Power Automate
Suggested Answer

Polymorphic Lookup Fields in Power Automate Flow

(1) ShareShare
ReportReport
Posted on by 297
I have a table with a polymorphic lookup field.
In a flow, I have a condition in which I want to test from which table the lookup comes. 
In the left box of the condition, I selected the dynamic content Field (Table Name), then equals, then the logical name of the table. 
If I try to save the flow, I get this error: Request to XRM API failed with error: 'Message: Flow client error returned with status code "BadRequest" and details "InvalidOpenApiFlow". Code: 0x80060467 InnerError: '.
What am I doing wrong?
Categories:
I have the same question (0)
  • Suggested answer
    Valantis Profile Picture
    6,735 on at
     
    The issue is that using the Table Name dynamic content directly in a condition node causes the InvalidOpenApiFlow error. The condition node cannot process that property type as a plain string comparison at design time, which breaks the flow schema validation.
     
    Try this . In the left side of the condition, switch to expression mode and use:
    items('Apply_to_each')?['new_lookup_logicalname']
    Replace new_lookup with the actual logical name of your polymorphic lookup field. The _logicalname suffix returns the table logical name as a plain string. Then compare it equals to the table logical name you want to check like account or contact.
    If you are not sure of the exact field name, add a Compose action before the condition, output the full record, run the flow once and check the output to find the correct _logicalname property.
     
    A couple of questions in case this does not work:
    1. Are you triggering the flow from a Dataverse trigger or another source?
    2. What is the exact logical name of your polymorphic lookup field?
     

     

    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/

     

  • Suggested answer
    11manish Profile Picture
    3,333 on at
    “Table Name” dynamic content is not usable in conditions
    Use:
    • lookuplogicalname (best)
    • OR @odata.type
    Fix removes InvalidOpenApiFlow error
     
    Use @odata.type 
    Polymorphic lookups include a hidden field like:
    • @odata.type: "#Microsoft.Dynamics.CRM.account"
    Condition:
    Use expression:
    • contains(triggerOutputs()?['body/_yourlookupfield_value@odata.type'], 'account')
    Replace:
    yourlookupfield with your field name
  • Valantis Profile Picture
    6,735 on at

    Hi @Hilda Steyn,

    Just wanted to check in and see if everything is working now. If you still need any help, feel free to let me know.

    Also, if the issue is resolved, it would be great if you could mark the answer as solved so others with the same question can find it easily.

     

    Thanks and have a great day!

     

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard