cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
RobEitzen
Level: Powered On

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.

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?

RobEitzen
Level: Powered On

Re: powerapp flow on select function not working

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

 

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?
RobEitzen
Level: Powered On

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.

RobEitzen
Level: Powered On

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.

Anonymous
Not applicable

Re: powerapp flow on select function not working

@Anonymous  any help here?

RobEitzen
Level: Powered On

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
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,664)