I created a PowerApps form to submit trade submissions for approval referencing reza's video here ((27) How to create Approval Forms in Power Apps - YouTube.
When I test with my self as the approver, I can select the PowerApps deep link in the email - it goes to directly to the trade review screen which is pre-populated form. There I can approve the request.
When I update the test case in the power automate workflow with another email address as the approver email address and they select the link they are re-directed to a new form instead of the original submission for approval.I
Here is what I have on the App Start Screen:
If(
!IsBlank(Param("ID")) && LookUp(
'Trade PreApproval Form',
ID = Value(Param("ID"))
).ApproverEmail = User().Email,
TradeReview,
TradeReqForm
)
Form (TradeReqForm) Submit OnSelect property:
If(
Form1.Valid, // Check if the form is valid
If(
!IsBlank(DataCardValue6.Text) || !IsBlank(DataCardValue9.Text),
SubmitForm(Form1);
Set(varNewRecordID, Form1.LastSubmit.ID);
Navigate(EndScreen),
Notify("Please complete the required fields", NotificationType.Error)
),
Notify("Please complete the required field", NotificationType.Error)
)
Form (TradeReqForm) OnSuccess:
'TradeSubmission-PROD'.Run(varNewRecordID);
TradeReview Screen, OnVisible property:
If(
!IsBlank(Param("ID")),
Set(
varItem,
LookUp(
'Trade PreApproval Form',
ID = Value(Param("ID"))
)
);
Set(
varFormMode,
FormMode.Edit
)
)
Yes that may cause some issues, but your fundamental issue is the navigation, which comes before this.
I think the issue may have been due to a restriction on the SP list. In advanced settings, settings changed to Read items that were created by the user.
I assume you are still testing as there is not much more I can add presently.
On Form2 (TradeReview screen) Item is set to varItem. Maybe I need to modify this with if condition. I am looking at some of your other posts and considering that option.
VarItem is set when a user selects NextArrow on the Gallery from AllRecords Screnn: Set(varItem, ThisItem)
Thanks Warren for your response. I checked the email and it's verified. Strange thing when I create a form using an Admin account, and set myself as the approver I can approve as it takes me directly to the prepopulated form.
The Test users experiences the same thing. When he submits and he himself is an approver he is able to go directly to the Trade review to submit approval.
I am checking the ID and it's getting set in the email so that too seems be as expected as well.
I moved the Variable for varNewRecordID to OnSuccess of Form1.
Set(varNewRecordID, Form1.LastSubmit.ID);
'TradeSubmission-PROD'.Run(varNewRecordID);
Hi @mthiru_0023 ,
Firstly, you do not need to look at any code other than this
If(
!IsBlank(Param("ID")) &&
LookUp(
'Trade PreApproval Form',
ID = Value(Param("ID"))
).ApproverEmail = User().Email,
TradeReview,
TradeReqForm
)
which simply says that if
then open the TradeReview Screen or if not, open the TradeReqForm Screen.
Two things here
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps