cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
yeveve
Level: Powered On

Black Approve Button

Hi!

 

The green "Approve" button only shows black. When I check it from the studio, there is an error wherein it says "Invalid argument type (Record). Expecting a Text value instead." Below are the codes. I'm really not sure if that is the one causing the color of the "Approve Button"

 

ForAll(
ReqGallery.Selected.GrpDetail,
If(
MgPost.Text = "Reviewer" && ReqGallery.Selected.Request_Status = "Submitted",
Patch(
'Requisition Forms (App)',
{ID: ID},
{Request_Status: "Reviewed"},
{Reviewed_Date: Now()},
{Reviewed_By: User().FullName}
),
MgPost.Text = "Manager" && ReqGallery.Selected.Request_Status = "Reviewed",
Patch(
'Requisition Forms (App)',
{ID: ID},
{Request_Status: "ManagerApproved"},
{ManagerApproved_Date: Now()},
{ManagerApproved_By: User().FullName}
),
MgPost.Text = "Approver" && ReqGallery.Selected.Request_Status = "ManagerApproved" && Value(TotalEstimatedPrice.Text) <= EstAmountLimitVar,
Patch(
'Requisition Forms (App)',
{ID: ID},
{Request_Status: "Processing"},
{Approval_Date: Now()},
{Approved_By: User().FullName}
),
MgPost.Text = "Approver" && ReqGallery.Selected.Request_Status = "ManagerApproved" && Value(TotalEstimatedPrice.Text) > EstAmountLimitVar,
Patch(
'Requisition Forms (App)',
{ID: ID},
{Request_Status: "FinalApproval"},
{Approval_Date: Now()},
{Approved_By: User().FullName}
),
MgPost.Text = "FinalApprover" && ReqGallery.Selected.Request_Status = "FinalApproval" && Value(TotalEstimatedPrice.Text) > EstAmountLimitVar,
Patch(
'Requisition Forms (App)',
{ID: ID},
{Request_Status: "Processing"},
{FinalApproval_Date: Now()},
{FinalApproved_By: User().FullName}
),
MgPost.Text = "ProcStaff" && ReqGallery.Selected.Request_Status = "Processing",
Patch(
'Requisition Forms (App)',
{ID: ID},
{Request_Status: "Completed"},
{Completed_By: User().FullName},
{Completed_Date: Now()}
)
)
);
If(
MgPost.Text = "Reviewer" && ReqGallery.Selected.Request_Status = "Submitted",
REQCKJEmail.Run(
ManagerEmailVar,
"For initial approval: " & Label14.Text & " from " & First(ReqGallery.Selected.GrpDetail).Author.DisplayName,
"New requisition was submitted for your approval. <p><p> REQUEST DETAILS: <p> Request Number: <b>" & Label14.Text & "</b><p> Requsition Title: <b>" & Label14_2.Text & "</b><p> Requestor: <b>" & First(ReqGallery.Selected.GrpDetail).Author.DisplayName & "</b><p> Date Needed: <b>" & Label15.Text & "</b><p> Total Estimated Price: <b>" & TotalEstimatedPrice.Text,
"",
First(ReqGallery.Selected.GrpDetail).Author.Email,
"Manager Approved: " & Label14.Text,
Label14.Text & " has been initially approved on " & First(ReqGallery.Selected.GrpDetail).Reviewed_Date & " and is now forwarded to Procurement Head for next approval."
),
MgPost.Text = "Manager" && ReqGallery.Selected.Request_Status = "Reviewed",
REQCKJEmail.Run(
ApproverEmaillVar,
"For approval: " & Label14.Text & " from " & First(ReqGallery.Selected.GrpDetail).Author.DisplayName,
"New requisition was submitted for your approval. <p><p> REQUEST DETAILS: <p> Request Number: <b>" & Label14.Text & "</b><p> Requsition Title: <b>" & Label14_2.Text & "</b><p> Requestor: <b>" & First(ReqGallery.Selected.GrpDetail).Author.DisplayName & "</b><p> Date Needed: <b>" & Label15.Text & "</b><p> Total Estimated Price: <b>" & TotalEstimatedPrice.Text,
"",
First(ReqGallery.Selected.GrpDetail).Author.Email,
"Procurement Head Approved: " & Label14.Text,
Label14.Text & " has been approved on " & First(ReqGallery.Selected.GrpDetail).ManagerApproved_Date & " and is now forwarded to Procurement Head for next approval."
),
MgPost.Text = "Approver" && ReqGallery.Selected.Request_Status = "ManagerApproved" && Value(TotalEstimatedPrice.Text) <= EstAmountLimitVar,
REQCKJEmail.Run(
ProcStaffEmaillVar,
"Ready for Processing: " & Label14.Text & " from " & First(ReqGallery.Selected.GrpDetail).Author.DisplayName & " needed on " & Label15.Text,
Label14.Text & ", needed on " & Label15.Text & " has been approved and is now ready for processing.",
"",
First(ReqGallery.Selected.GrpDetail).Author.Email,
"Approved: " & Label14.Text,
Label14.Text & " has been approved on " & First(ReqGallery.Selected.GrpDetail).Approval_Date & " and is now forwarded to HR for processing."
),
MgPost.Text = "Approver" && ReqGallery.Selected.Request_Status = "Submitted" && Value(TotalEstimatedPrice.Text) > EstAmountLimitVar,
REQCKJEmail.Run(
FinalApproverEmaillVar,
"Final Approval: " & Label14.Text & " from " & First(ReqGallery.Selected.GrpDetail).Author.DisplayName & " needed on " & Label15.Text,
Label14.Text & ", needed on " & Label15.Text & " has been initially approved and is requesting for final approval.",
"",
First(ReqGallery.Selected.GrpDetail).Author.Email,
"For Final Approval: " & Label14.Text,
Label14.Text & " has been initially approved on " & First(ReqGallery.Selected.GrpDetail).Approval_Date & ". Requested item/s with total estimated price exceeding USD 10,000 is subject to final approval. An email will be sent to you as soon as your request is approved and is ready for processing."
),
MgPost.Text = "FinalApprover" && ReqGallery.Selected.Request_Status = "FinalApproval" && Value(TotalEstimatedPrice.Text) > EstAmountLimitVar,
REQCKJEmail.Run(
ProcStaffEmaillVar,
"Ready for Processing: " & Label14.Text & " from " & First(ReqGallery.Selected.GrpDetail).Author.DisplayName & " needed on " & Label15.Text,
Label14.Text & ", needed on " & Label15.Text & " has been approved and is now ready for processing.",
"",
First(ReqGallery.Selected.GrpDetail).Author.Email,
"Approved: " & Label14.Text,
Label14.Text & " has been approved on " & First(ReqGallery.Selected.GrpDetail).FinalApproval_Date & " and is now forwarded to HR for processing."
),
MgPost.Text = "ProcStaff" && ReqGallery.Selected.Request_Status = "Processing",
REQCKJEmail.Run(
First(ReqGallery.Selected.GrpDetail).Author.Email,
"Completed: " & Label14.Text,
Label14.Text & " is now completed. Please contact our HR department for any matter regarding this request.",
"",
"editedemailaddress",
"ReqCompleted",
""
)
);
UpdateContext({UpdateStatVisible: false})

 

 

 

 

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Black Approve Button

Hi @yeveve

I think the reason the button appears black is because the request status of the selected item in you ReqGallery doesn't meet the conditions Submitted, FinalApproval, or Processing. You can set the button to green in this scenario using the following formula:

If(ReqGallery.Selected.Request_Status="Submitted",
   RGBA(54, 176, 75, 1),
   ReqGallery.Selected.Request_Status="FinalApproval",
   RGBA(54, 176, 75, 1),
   ReqGallery.Selected.Request_Status="Processing",
   RGBA(56, 86, 153, 1),
   Green
)

View solution in original post

5 REPLIES 5
Super User
Super User

Re: Black Approve Button

Hi @yeveve

If you select the button, go to the Advanced section in the properties pane and view the 'Fill' property, can you tell us what that says? That's the property that controls the back color.

Also, where did you specify the code that you posted? Did you set that against the OnSelect property?

Highlighted
yeveve
Level: Powered On

Re: Black Approve Button

Hi timl!

 

Thank you very much for replying back. Below is the formula for the Fill under Advanced.

 

If(ReqGallery.Selected.Request_Status="Submitted", RGBA(54, 176, 75, 1),ReqGallery.Selected.Request_Status="FinalApproval", RGBA(54, 176, 75, 1), ReqGallery.Selected.Request_Status="Processing",RGBA(56, 86, 153, 1))

 

For the second question, yes, that is under the OnSelect property. Please see screenshot.

 

 

Thanks!

yeveve
Level: Powered On

Re: Black Approve Button

Hi!

 

This is the code that has a red underline. I'm not sure what is wrong with this. It says "The function 'Run' has some invalid arguments.'

 

REQCKJEmail.Run(
ManagerEmailVar,
"For initial approval: " & Label14.Text & " from " & First(ReqGallery.Selected.GrpDetail).Author.DisplayName,
"New requisition was submitted for your approval. <p><p> REQUEST DETAILS: <p> Request Number: <b>" & Label14.Text & "</b><p> Requsition Title: <b>" & Label14_2.Text & "</b><p> Requestor: <b>" & First(ReqGallery.Selected.GrpDetail).Author.DisplayName & "</b><p> Date Needed: <b>" & Label15.Text & "</b><p> Total Estimated Price: <b>" & TotalEstimatedPrice.Text,
"",
First(ReqGallery.Selected.GrpDetail).Author.Email,
"Manager Approved: " & Label14.Text,
Label14.Text & " has been initially approved on " & First(ReqGallery.Selected.GrpDetail).Reviewed_Date & " and is now forwarded to Procurement Head for next approval."
),

 

 

 

 

 

 

 

 

 

Thanks!

Super User
Super User

Re: Black Approve Button

Hi @yeveve

I think the reason the button appears black is because the request status of the selected item in you ReqGallery doesn't meet the conditions Submitted, FinalApproval, or Processing. You can set the button to green in this scenario using the following formula:

If(ReqGallery.Selected.Request_Status="Submitted",
   RGBA(54, 176, 75, 1),
   ReqGallery.Selected.Request_Status="FinalApproval",
   RGBA(54, 176, 75, 1),
   ReqGallery.Selected.Request_Status="Processing",
   RGBA(56, 86, 153, 1),
   Green
)

View solution in original post

yeveve
Level: Powered On

Re: Black Approve Button

Hi!

 

Thank you very much. I'm in the process of testing this. I would just like to ask another question. With the formula below for "text" from this approve button, should it show "Approve" or "Mark as complete"? I haven't tested it yet because I'm afraid that I might mess up the approval routing (I'm really new to this and project was just handed to me because the one who was working with this left already)

 

Upper(If(MgPost.Text="Approver" && ReqGallery.Selected.Request_Status="Submitted", "Approve", MgPost.Text="FinalApprover" && ReqGallery.Selected.Request_Status="FinalApproval", "Approve", MgPost.Text="ProcStaff" && ReqGallery.Selected.Request_Status="Processing", "Mark as Complete"))

 

Thanks!

Helpful resources

Announcements
thirdimage

Power Automate 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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,001)