cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
astockli
Microsoft
Microsoft

Passing dropdown selections to Flow

I have created an App that will input three different fields and create an ADO request:  2 text fields and one dropdown field made in PowerApps.

 

When I attempt to pass the variables into my flow I get this message in PowerApps - "The function Run has some invalid arguments".  I have searched on the found some postings referring to using "Dropdown.Selected.Value" in the Run command but that doesn't appear to work either.  There are red lines under the Selected.Value part.

 

Here is what I am putting in: FLOW.Run(Createaworkitem_Title,Createaworkitem_Description,Createaworkitem_OtherFields.Selected.Value); Navigate(Success, ScreenTransition.None)


1 ACCEPTED SOLUTION

Accepted Solutions

@astockli 

Ah, so now the story unfolds...

Your signature for your Flow to PowerApps is Text, Text, Record

However, the reality is you want Text, Text, Text to go in.

Your original Formula in your first post is fine.  The problem is your Flow definition. 

The unfortunate part is that you can't easily change the input types on Flow for PowerApps.  Once it has determined that you needed a record (if you needed it or not), it will remember that for its signature.

You have two (sort of three) choices:

1) Rebuild your Flow from scratch and make sure you are getting only string type parameters/input from Ask PowerApps

2) Put in another Ask PowerApps parameter in your existing Flow for the text value.  This will add another parameter to your flow signature in powerapps.  For the record parameter, you can then substitute a {} for an empty record (as you'll not use it anyway).

3ish) There is a Flow editor that will alow you to edit the JSON definition of your Flow.  There you can manually change the definition.  I would only recommend this if you have already created a complex Flow and starting from scratch is not an option.

 

I hope that helps clear it up for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

11 REPLIES 11
RandyHayes
Super User
Super User

@astockli 

What is the error for the red lines when you hover over it?

What are the Items for your DropDown?  If it is a record from a DataSource, then you would need to specify the column/field name rather than a Value.  In other words, the options available on the "Selected" will depend on the items you have in the control.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

It says "Invalid argument (Text).  Expecting a record value instead"    The list is just one created within PowerApps:

["","Value1","Value2","Value3"]

@astockli 

So there it is...look at your Flow parameters that come up in your Formula - it is looking for a Record not a Text.

If you pass the Selected.Value, you are passing a text item to it and it is not what it wants.  You can try to drop the DropDown.Selected.Value and just pass the DropDown.Selected instead, but I would have a serious look at your Flow as you seem to be thinking that passing a text value is what you want.  If not, then yes, pass it the record.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
v-monli-msft
Community Support
Community Support

Hi @astockli ,

 

Are both Createaworkitem_Title and Createaworkitem_DescriptionI text controls' names? If so, I think the issue could be that you didn't add ".Text" at the end of text control. The formula should be:

FLOW.Run(Createaworkitem_Title.Text,Createaworkitem_Description.Text,Createaworkitem_OtherFields.Selected.Value); Navigate(Success, ScreenTransition.None)

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@RandyHayes 

 

I tried the .Selected and the app now runs but it is passing a blank value to the flow.

 

I am using an Azure DevOps connector in Flow with the Product field equal to Createaworkitem_OtherFields.  (see attached)  In PowerApps it is a custom dropdown field.  

 

I'm new to PowerApps so I'm not sure how to pass it as a Record if that is what needs to be done.

 

 

@astockli 

So it seems that the type mismatch on the parameter you were passing was the primary issue...now to get the correct information.

First I would reflect on @v-monli-msft 's posting.  Make sure you are passing the .Text if those first parameters are Controls.  If they are just fields from your datasource or variables, then you should be fine there.

You can always look at a previous run of Flow results and click on the top block of your flow to expand it.  That will show you everything that was passed in and what type it is.

Now for that last parameter...do you want a text value to go to flow, or a record?

What function are you calling on the DevOps connector? 

Make sure you are passing the proper type that the function wants.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 

 

I am using the Create a work item connector with Azure DevOps.  All three fields are used in flow as an "Ask in PowerApps" value.  The first 2 are input directly from the App and the third is the custom dropdown in PowerApps.  I would think if it came in as a text value it would work fine.  I tested this by editing the Flow and inputing a text value in place of the Createaworkitem_OtherFields item.  The Flow worked fine with this test and created the work item.

@astockli 

Ah, so now the story unfolds...

Your signature for your Flow to PowerApps is Text, Text, Record

However, the reality is you want Text, Text, Text to go in.

Your original Formula in your first post is fine.  The problem is your Flow definition. 

The unfortunate part is that you can't easily change the input types on Flow for PowerApps.  Once it has determined that you needed a record (if you needed it or not), it will remember that for its signature.

You have two (sort of three) choices:

1) Rebuild your Flow from scratch and make sure you are getting only string type parameters/input from Ask PowerApps

2) Put in another Ask PowerApps parameter in your existing Flow for the text value.  This will add another parameter to your flow signature in powerapps.  For the record parameter, you can then substitute a {} for an empty record (as you'll not use it anyway).

3ish) There is a Flow editor that will alow you to edit the JSON definition of your Flow.  There you can manually change the definition.  I would only recommend this if you have already created a complex Flow and starting from scratch is not an option.

 

I hope that helps clear it up for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 

 

I rebuilt my flow from scratch and initialized string variables for each of the parameters I passed from PowerApps.  Once I had that set up everything worked great.  Thanks for the help!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,886)