cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
papp
Level: Powered On

Run a flow from PowerApps dropdown

Hi,

 

I have a drop down in PowerApps and I would like to get the Country list values from flow. Flow is using Execute a SQL query to get list of countires. I am using PowerAppsbutton.CountryList.Run() but I get an error 'Invocation of unknown or unsupported function'. Please help.

1 ACCEPTED SOLUTION

Accepted Solutions
KarlHoffmaster
Level: Powered On

Re: Run a flow from PowerApps dropdown

One thing you may want to try to simplify things is to create a SQL view based on  your table.  You can create the exact list you need in SQL using "distinct", "Grouping", and "where clauses" as needed.  Once you have the view saved, you can add it as a data source and use it to feed your drop down.  You can further filter it if necessary based on other controls.  

Confluent
10 REPLIES 10
Super User
Super User

Re: Run a flow from PowerApps dropdown

Can you provide a screenshot of your app and a bit more detail.  In which control and which property are you entering

PowerAppsbutton.CountryList.Run()


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
papp
Level: Powered On

Re: Run a flow from PowerApps dropdown

Hi Pstork1,

 

I am trying to add it to dropdown control and Onselect Action. 

 

Here is some background... I want to have a dropdown with country list from a SQL table. There are 35 distinct countries in SQL table with ~4k rows, but having that in dropdown is not returning all 35 countries (I am doing a distinct and sort). I am looking if there is an option to call a flow from PowerApps dropdown where flow has a SQL connecor with Execute a SQL query (Select distinct country from Table order by Country)

 

 

Thanks,

Pragna

 

 

Community Support Team
Community Support Team

Re: Run a flow from PowerApps dropdown

Hi @papp ,

Could you please share a bit more about your scenario?

Do you want to fire a flow when you click the Dropdown box, then populate the returned Country lists from flow into this Dropdown box?

 

Based on the needs that you mentioned, I have made a test on my side, please consider take a try with the following workaround:

Flow's configuration as below:6.JPG

Within the query field of the "Execute a SQL Query" action, type your SQL Syntax formula.

Within the "Response" action, set the Body field to following formula:

body('Execute_a_SQL_query')?['ResultSets']?['Table1']

set the "Response Body JSON Schema" field to following formula:

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "DepartId": {
                "type": "integer"
            },
            "DepartName": {
                "type": "string"
            }
        },
        "required": [
            "DepartId",
            "DepartName"
        ]
    }
}

On your side, you may type:

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "Column1": {
                "type": "integer"
            },
            "Column2": {
                "type": "string"
            },
... }, "required": [ "Column1", "Column2",
... ] } }

More details about returning an array table from a flow to an app, please check the following blog:

https://powerapps.microsoft.com/en-us/blog/return-an-array-from-flow-to-powerapps-response-method/

 

App's configuration as below:7.JPG

 

8.JPG

Set the OnSelect property of the Dropdown box to following:

ClearCollect(DeptCollection,'20190710_case11'.Run())

On your side, you should type:

ClearCollect(CountryCollection,'YourFlowName'.Run())

then set the Items property of the Dropdown box to following:

CountryCollection

Please check the following GIF screenshot for more details:Test.gif

 

More details about firing a flow from a canvas app, please check the following video:

https://www.youtube.com/watch?v=1wl9AtxWdkg

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
papp
Level: Powered On

Re: Run a flow from PowerApps dropdown

Hi v-xida,

 

Thank you for the detailed info. I followed the same steps as you mentioned but the dropdown is empty for me. Please find the attachement.

shailendra74
Level 8

Re: Run a flow from PowerApps dropdown

Hi @papp 

 

Please check the SQL statement given in Execute a Sql query

 

Select distinct country from <<table>>

where country IS NOT NULL

order by country

 

Thanks.

Community Support Team
Community Support Team

Re: Run a flow from PowerApps dropdown

Hi @papp ,

Currently, I could not reproduce your issue on my side.

 

Please check if the SQL Syntax you typed within the "Execute a SQL Query" action is proper. Also please go the flow run history, check if the "Execute a SQL Query" action within your flow return a proper table result.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
papp
Level: Powered On

Re: Run a flow from PowerApps dropdown

Hi Shailendra,

 

I updated the query but still no luck. 

papp
Level: Powered On

Re: Run a flow from PowerApps dropdown

Hi v-xida,

 

I see the flow history and it succeeds with the right output but the dropdown is still showing me blank.

 

 

Thanks,

Pragna

KarlHoffmaster
Level: Powered On

Re: Run a flow from PowerApps dropdown

One thing you may want to try to simplify things is to create a SQL view based on  your table.  You can create the exact list you need in SQL using "distinct", "Grouping", and "where clauses" as needed.  Once you have the view saved, you can add it as a data source and use it to feed your drop down.  You can further filter it if necessary based on other controls.  

Confluent

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 180 members 5,511 guests
Please welcome our newest community members: