About Azure OpenAI collaboration with PowerApps

mitttttsu 20 Reputation points
2024-05-17T04:24:56.8266667+00:00

I am planning to create an image generation app using Azure OpenAI using PowerApps.

I am considering a mechanism to generate an image by pressing a button based on the content entered in "TextInput1" area.

I have created the following as a connector and have completed testing its operation.

Definition : DALLE

Operation ID : DALLE

I created a button on PowerApps and entered the following in the "Onselect" function.

Set(
    ttt,
    DALLE.DALLE(
        {
            'api-version':"2024-02-15-preview",
            'Content-type':"application/json",
            prompt: TextInput1.Text,
            n:1,
            size:"1024x1024"
        }
    ).url
);


And, I entered "ttt" in the "Text" area of the label button.

However, clicking the button did not display anything and no error occurred.

Is there any kind soul who can help me solve this issue?

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,792 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Gowtham CP 2,920 Reputation points
    2024-05-17T06:09:12.9533333+00:00

    Hello mitttttsu ,

    Thanks for reaching out in the Microsoft Q&A!

    To fix the issue, update your PowerApps OnSelect function with the following code:

    Set(
      YourImageName.Image,
      DALLE.DALLE(
        {
          'api-version': "2024-02-15-preview",
          'Content-type': "application/json",
          prompt: TextInput1.Text,
          n: 1,
          size: "1024x1024"
        }
      ).results[0].url
    )
    

    This code sets the generated image URL as the Image property of an Image control named YourImageName. Kindly Replace YourImageName with the actual name of your Image control.

    If you found this solution helpful, consider accepting it.


  2. PRADEEPCHEEKATLA-MSFT 81,151 Reputation points Microsoft Employee
    2024-05-20T12:00:08.8566667+00:00

    @mitttttsu - Thanks for the question and using MS Q&A platform.Power Automate is currently not supported in the Microsoft Q&A platform; the supported products are listed over here https://docs.microsoft.com/en-us/answers/products (more to be added later on).

    You can raise a question on Power Automate Community: https://powerusers.microsoft.com/t5/Microsoft-Power-Automate/ct-p/MPACommunity

    This will assist you with a faster reply to your query.