Hi All,
I've been following Reza's tutorial for creating approval workflows in Power Apps and deep linking (https://www.youtube.com/watch?v=Om4beefKmV0) since I'm trying to have the entire workflow be within Power Apps. Everything goes well but when I test the flow I get the following error in Power Apps: Run failed: The method 'Run' has an invalid value for parameter 'number'- this is what the flow looks like for that portion:
Here is how it is set up
Within the form:
OnSuccess- If(varFormMode = FormMode.New, TMApproval.Run(New_TM_Form.LastSubmit.ID);); Notify("TM updated successfully",NotificationType.Success); Navigate('Home Screen')
Thoughts?
Thanks @v-xiaochen-msft
I've stored the variable (varItem) in the on success attribute (see below):
//on success send email to approver email
ViewForm(New_TM_Form);
Set(varItem, New_TM_Form.LastSubmit);
If(varItem.Status.Value="Pending Approval",
Office365Outlook.SendEmailV2(
varItem.'Approver'.Email,
"TM Submission - Approval Required",
"A TM was submitted for "&varItem.'Subject of the TM'.DisplayName&" on "&varItem.'Date conflict identified'&". <a href="""&varAppID&"?ID="&varItem.ID&""">Click here</a> to approve/reject the TM."
)
)
The email gets sent but when I click it still goes to the home page with the correct ID
Hi @gabequinn__ ,
In Powerapps.
Usually, we can use formula <Set(var,New_TM_Form.LastSubmit.ID)> to save it. It's a global variable in the app.
We can use the formula in the button when we submit the form. SubmitForm(form);Set(var,New_TM_Form.LastSubmit.ID)
Or we can use it on onsuccess attribute of the form:
Set(var,New_TM_Form.LastSubmit.ID)
The benefit is that it allows us to troubleshoot the problem simply.
After creating the variable, we can add a label to display the value of the variable.
Best Regards,
Wearsky
Thanks for the reply @v-xiaochen-msft
When you say save the ID value to a variable first- do you mean in power apps or power automate? If in power apps, how?
Hi @gabequinn__ ,
I guess the value of New_TM_Form.LastSubmit.ID is cleared because of some wrong operations.
Can you save the ID value to a variable first when submitting the data?
Then we can use the variable instead of using New_TM_Form.LastSubmit.ID.
Best Regards,
Wearsky
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2