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 Apps / Regarding Azure AI Fou...
Power Apps
Answered

Regarding Azure AI Foundry Inference connector in Power Apps.

(2) ShareShare
ReportReport
Posted on by 8
I dont get an error with:
AzureAIFoundryInference.ChatCompletion(
    {
        'api-version': "2025-04-01-preview",
        model: "gpt-5-chat",
        max_tokens: 500,
        temperature: 1,
       
        messages: [
            {
                role: "user",
                content: Table(
                    {
                        Value: ParseJSON(
                            JSON(
                                {
                                    type: "text",
                                    text: TextInput2.Text
                                }
                            )
                        )
                    }
                )
            }
        ]
    }
)

but i do with:
AzureAIFoundryInference.ChatCompletion(
    {
        'api-version': "2025-04-01-preview",
        model: "gpt-5-chat",
        max_tokens: 500,
        temperature: 1,
       
        messages: [
            {
                role: "user",
                content: [
                    {
                        type: "text",
                        text: TextInput2.Text
                    }
                ]
            }
        ]
    }
)


The Core Problem
  1. The API requires a standard content array: [{ "type": "text", "text": "..." }]. This structure works perfectly in the Power Automate version of this connector.
  2. However, using this correct structure in Power Apps throws a validation error: Missing column 'messages.content.Value'.
  3. If we modify the formula to satisfy this error by adding a Value column, the connector generates an incorrect JSON payload, wrapping the content inside an extra "Value": [...] layer.
  4. The API then correctly rejects this malformed request, making a successful call from Power Apps impossible.
Any ideas on how to deal with this?
Categories:
I have the same question (0)
  • Verified answer
    developerAJ Profile Picture
    4,763 on at
    "
     
    Set(myVar, ParseJSON("{""myValue"" : ""Return in HTML format remove html header, " & TextInput2.Text & """}"));
    Set(test,AzureAIFoundryInference.ChatCompletion(
        {
            model:"gpt-5-chat",
            api_version :"2025-01-01-preview",
            top_p:1.0,
            temperature:1.0,
            max_tokens:16384,
            messages:([{role:"user",content:Table( {type:"text", Value:myVar.myValue})}])
           
       
        }
    ))
    " can you try this out i found this when i was looking for some solutions for connections
     

    If this solution helped you resolve your issue, kindly mark it as accepted — it makes it easier for others to find and also closes the discussion. If you found it useful, a Like ❤️ would be greatly appreciated!

    🤝 Let’s connect on LinkedIn || 📘 Explore more on my articles

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,041

#2
11manish Profile Picture

11manish 676

#3
Valantis Profile Picture

Valantis 655

Last 30 days Overall leaderboard