cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

powerapp flow on select function not working

Ok, here's my issue. I'm using flow to call a sql stored procedure to update a sql table via powerapps. I created the flow and i was hoping the funciton to call the flow in powerapps would be easy. well, i guess not. Here's the function i'm using on the onselect property of the submit icon. Can someone corrrect me if i'm wrong here?

 

PowerAppsbutton.Run(Value(DataCardValue5.Text),DateValue1.SelectedDate,DateValue2.SelectedDate,DataCardValue11.Text,DataCardValue6.Text,Dropdown1.Selected,DataCardValue6.Text)

 

See screen shot of the flow below.

 

Here's the error i'm getting in powerapps by the way: Invalid argument type (Record). Expecting a Text value instead.

 

 

8 REPLIES 8
Highlighted
Advocate I
Advocate I

Re: powerapp flow on select function not working

I had a similar issue when I switched from a SQL view to Flow/StoredProcedure.  It had to do with the date fields when I received a similar error (red "X" on my Flow Run call).

 

PowerApps & SQL don't speak "date" field types.  The date is returned formatted as a string "yyyymmddThhmmss".  PowerApps likes "datetime" or "smalldatetime" better.  What is the field datatype in your SQL table for any date/time values?

 

Try formatting the date field in the JSON:

           "InitialContact": {
                "type": "boolean"
            },
            "DateInterview1": {
                "type": "string",
                "format": "date-time"
            },

This may or may not work depending on your sql field type.

 

You may need to work with the date value as a string and convert to date before using it in your PowerApps app.  The "DateTimeValue()" may help.

Highlighted
Anonymous
Not applicable

Re: powerapp flow on select function not working

they are all date time fields with with this format "2019-02-12 09:58:18.130".

 

Apart from the datetime conversion, am i doing the powerapps on select icon function correctly?

Highlighted
Advocate I
Advocate I

Re: powerapp flow on select function not working

I've attached a screen shot from my Flow.  Is the "Body"Flow.png?

 

Highlighted
Anonymous
Not applicable

Re: powerapp flow on select function not working

So my flow looks exactly like yours. The only issue is that I’m not seeing resultset.table1 as an option in the body section. Am I missing a step?
Highlighted
Advocate I
Advocate I

Re: powerapp flow on select function not working

Is your stored procedure returning a recordset (table) or variable or ??

 

What is being returned if you use the available resultset?

 

If you are not already collecting the response, try:

ClearCollect(collectStoredProcResults, storedprocFlowName.Run(<parameter1>,<paramter2>)

Then, output the collection to a gallery.

Highlighted
Advocate I
Advocate I

Re: powerapp flow on select function not working

Now that I look at it, your JSON may be missing the array object.  Brian Dang has a blog post that will give you the best way to create the response JSON:

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

 

This is the one that got me started.

Highlighted
Anonymous
Not applicable

Re: powerapp flow on select function not working

@Anonymous  any help here?

Highlighted
Advocate I
Advocate I

Re: powerapp flow on select function not working

Have you had a chance to review the link posted in the previous reply?  There is a section there that will tell you exactly how to craft the Response step.  This is what you are missing.

 

Take a look and if you still cannot find it, I'm happy to write it out.  Brian does a great job, so you shouldn't have any problem.

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,648)