Hi all,
I have an app that tracks hours spent working on engineering projects. When an engineer submits their hours, my app needs to update a SharePoint site that logs the hours spent on each project. If any Engineer tries to submit hours for a day in the past, we require they get approval. My app currently logs the hours just fine, however I am struggling with getting the flow for an approval working in the app.
I have tried creating a flow based on a power app button, but am struggling with the formula to make it run properly. I have tried setting the OnSelect with a Run() formula, but I'm not sure if this is the ideal way to pull it off. I tried making a formula using Run, but I can't seem to get the syntax down. I'll include images, if anyone can help, I would greatly appreciate it!
Hey, you're getting the error, because you're trying to pass 6 arguments instead of 5 probably:
I suspect a data type mismatch.
First, on your two choice fields try using, Selected.Value, not just Selected.
Second, is your hours field expecting a numeric value? If so, you'll need to use Value(DataCardValue21.Text) to convert to numeric.
If you turn on Monitor, you can get additional insights into what is failing.
Use the request tab to see exactly what values are getting passed.
Use the response tab to see what error is being generated.
Could there be a problem with the flow? The order is correct in the formula bar, it's possible that ".Selected" is the wrong follow up to Dropdown2_1 and 3_1, but I have no idea what to try instead, nothing else like .Text or .SelectedText works. I'm not sure how to " try passing constants for each of the 5 fields first and then substitute in the field you want to use one at a time until you figure out which one is generating your error" as I can't get the button to work while trying to set up the formula for the flow.
I don't really know where to go from here.
Disregard my previous comment. There have been some improvements in launching a flow since I last used one. Your flow name is integrated into the .Run. Verify that all of your parameter values are the correct fields and in the correct order. In order to isolate which is the problem, you might try passing constants for each of the 5 fields first and then substitute in the field you want to use one at a time until you figure out which one is generating your error.
PowerAppsbutton.Run(PowerAppsbutton, DataCardValue24.Text,DataCardValue18.SelectedDate, Dropdown2_1.Selected, Dropdown3_1.Selected, DataCardValue21.Text, DataCardValue22.SelectedItems)
This still returns an error, so I'm not sure how I need to change the argument.
It's telling me that it expects 5 arguments, I'll include them below
I've also tried this to no success:
PowerAppsbutton.Run('Engineering Project Timing Matrix', DataCardValue24.Text,DataCardValue18.SelectedDate, Dropdown2_1.Selected, Dropdown3_1.Selected, DataCardValue21.Text, DataCardValue22.SelectedItems)
Any ideas?
You are missing the name of the flow that you are trying to run. The first value after the open parenthesis should be the name of the flow, followed by the additional parms you want to pass. Right now it has no idea which flow you are trying to run.
I have a formula that looks like this when I try to connect the flow:
PowerAppsbutton.Run(DataCardValue24.Text,DataCardValue18.SelectedDate, Dropdown2_1.Selected, Dropdown3_1.Selected, DataCardValue21.Text, DataCardValue22.SelectedItems)
The entire thing is underlined, so I'm not sure where the error actually is
The button currently just has SubmitForm(Form3) in the On Select field. It updates the SharePoint without any problems. There is currently no error, but it does not run a flow to get an approval like I want it to. Even if the date is in the past, it's fine to have the form update the SharePoint site, but I need a manager to be notified that a project has been updated with a date in the past. They then need to be able to "approve" the hours which could be as simple as putting the word "approved" in a column on the same SharePoint site.
I'll include an image, as stated, I can write to the site no issues, I just need to get an approval built in based on the date being in the past.
"Approved" could go under title
What happens when you click request approval? Are you getting an error? And what do you have in that On Select for the button?
WarrenBelz
146,658
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional