|
Control name
|
Property
|
Formula
|
What’s happening here?
|
Button
|
btnSubmitExpense
|
OnSelect
|
ClearCollect(Approvers,ForAll('Expense
Configurations',If(Value(Min_x0020_Amount)<Value(valTotalAmount.Text)
&& Value(Max_x0020_Amount)>Value(valTotalAmount.Text),Approver)));
Patch('Expense
Submissions',{ID:SharePointItemID},{Status:"Submitted",Approver:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims:Concatenate("i:0#.f|membership|",First(Approvers).Email),
DisplayName:First(Approvers).DisplayName,
Email:First(Approvers).Email,
Department:First(Approvers).Department,
JobTitle:First(Approvers).JobTitle,
Picture:First(Approvers).Picture
}});
RequestHide();
|
1.
Get the Approver for the
amount.
2.
Save the data to “Expense
Submission list”
3.
Close the form
|
Visible
|
If(DataCard7.Default="Saved",true,false)
|
Show Submit button only when the status is “Saved”
|
OnSelect
|
Navigate(AddExpenses,Fade)
(We will add AddExpenses screen
next step)
|
Navigates to AddExpense Screen
|
Visible
|
If(DataCard7.Default="Saved",true,false)
|
btnAddExpenses button only visible when status of the expense is
Saved
|
Edit Icon
|
editIcon
|
OnSelect
|
EditForm(FormNew);
Navigate(FormScreenNew,Fade)
|
1.
Change the mode of the
FormNew to “EditForm” so that users can edit it.
2.Navigate to “FormNew” now.
|
Visible
|
If(DataCard7.Default="Saved",true,false)
|
Toggle Edit icon depending on the Saved Status.
|
Label
|
valTotalAmount
|
Text
|
Sum(Filter('Expense
Details',
(If(IsBlank(SharePointIntegration.Selected) ||
IsEmpty(SharePointIntegration.Selected),Last('Expense
Submissions').ID,SharePointIntegration.SelectedListItemID))=Expense.Id),Amount)
|
Show the
sum of all the Added sub category Expenses.
|
Button
|
btnApprove
|
OnSelect
|
Patch('Expense
Submissions',First(Filter('Expense Submissions', ID=SharePointItemID)),{Status:"Approved"});RequestHide()
|
OnSelect of
btnApprove, it will make expense status in “Expense Submission” list to Approved
|
Visible
|
If(SharePointIntegration.Selected.Status="Submitted"
&& User().Email=SharePointIntegration.Selected.Approver.Email,true,false)
|
Show
approve button only if status is Submitted & user’s email is in the
approver list.
|
OnSelect
|
Patch('Expense
Submissions',First(Filter('Expense Submissions',
ID=SharePointItemID)),{Status:"Rejected"});RequestHide()
|
OnSelect of
btnReject, it will make expense status in “Expense Submission” list to
Rejected
|
Visible
|
If(SharePointIntegration.Selected.Status="Submitted"
&&
User().Email=SharePointIntegration.Selected.Approver.Email,true,false)
|
Show reject
button only if status is Submitted & user’s email is in the approver
list.
|
Label
|
lblTotalAmount
|
Text
|
Total
expenses:
|
It will
hold the text for total amount
|
Screen
|
EditFormSreen
|
Visible
|
If(IsBlank(SharePointIntegration.Selected)
|| IsEmpty(SharePointIntegration.Selected),Set(SharePointItemID,Last('Expense
Submissions').ID),Set(SharePointItemID,SharePointIntegration.SelectedListItemID))
|
If a List
item is NOT already selected, then load the Last Saved List Item ID else get
the List Item ID of the item select.
Save the ID
from the above condition in “SharePointItemID” variable.
|
Form
|
FormEdit
|
Item
|
If(IsBlank(SharePointIntegration.Selected)
|| IsEmpty(SharePointIntegration.Selected),Last('Expense
Submissions'),SharePointIntegration.Selected)
|
Set the
datasource of the form to either List Item user has selected or the Last
saved.
|
Title
|
View text
|
Convert
Title field to read-only
|
Approver
|
|
Convert
approver field to read-only
|
From
|
View text
|
Convert
From field to read-only
|
To
|
View text
|
Convert To
field to read-only
|
Status
|
View text
|
Convert
Status field to read-only
|
Description
|
View text
|
Convert
Description field to read-only
|