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

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

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

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

 

Highlighted
Anonymous
Not applicable

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

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

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

@Anonymous  any help here?

Highlighted

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (11,949)