Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Python optimizer / PowerApps / Automate

Hi all,

 

My use case is as follows: given user input (a single monetary value), I would like to optimize a set of given items.

 

My initial thoughts are:

1. Build a PowerApps app + connect in powerbi, that just takes user input

2. Connect to Flow -- when user input received, execute Flow (power automate)

3. This Flow will in turn run a python file that calls an optimizer library (PuLP) -- based on the input variable, and constraints, selects items that maximize that input. This may be possible using Azure Function API? 

4. Then the result of that py file is sent back to Flow, and then back to powerapps somehow...

 

I am fairly new to powerapps / powerbi, so I'd like to get your suggestions. Is this a feasible approach highlighted above?

17 Replies

Replies have been turned off for this discussion
  • Anonymous's avatar
    Anonymous
    Not applicable

    HI Anonymous,

    #1, You can create PowerApps with parameters, then they allow you to input parameters.

    Launch and Param functions in Power Apps 

    #2, Please check the following link about use PowerApps with ms flow.

    Start a flow in a canvas app 

    #3, You can do these with Azure functions, you can take a look at the below link to know more about these.

    Create your first function in the Azure portal 

    #4, You can refer to the following blog about invoke the Azure function in flow:

    Invoke an Azure Function Using Power Automate (Flow)

    Regards,

    Xiaoxin Sheng

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Anonymous ! Thanks for the great help!

       

      Sorry about delay -- I am trying to do step3 and having this issue

      "One or more errors occurred. (Error while copying content to a stream.)"

       

      I followed step by step -- i am logged into az, I am using their HTTP Example, but still nothing worked. If you know of a fix for this, I'd appreciate it -- I will keep you updated. thanks again.

      • Anonymous's avatar
        Anonymous
        Not applicable

        It fails at this command: func new --name HttpExample --template "HTTP trigger" --authlevel "anonymous"

  • Anonymous's avatar
    Anonymous
    Not applicable

    is there a way to avoid powerapps ? 

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Anonymous,

      So you mean you want to directly use ms flow to invoke python script and azure functions without power app?
      If this is the case, you can directly use ms flow to do these things without the power app. The first two steps not necessary in these operations, you can avoid them and only use ms flow.
      Regards,

      Xiaoxin Sheng