Action Fails based on required_if column

I have two columns: โ€œTimecard Approved?โ€ and โ€œReject Reason.โ€

The Supervisor reviews individual timecards and if anything is missing, they hit an action button - โ€œReject Timecardโ€ - which sets the โ€œTimecard Approved?โ€ column to โ€œReject.โ€

This was working as expected until I set the column โ€œReject Reasonโ€ to required if โ€œTimecard Approved?โ€ = โ€œReject.โ€

This now prevents the action from firing and shows the following error message once I hit the โ€œReject Timecardโ€ action:

Screen Shot 2020-01-07 at 2.53.30 PM

Is there a workaround for this?

0 8 543
8 REPLIES 8

@Dialect_Junk
What do you expect to happen when the action executes correctly other than recording โ€œRejectedโ€ value to the respective column?

Thatโ€™s the only action - set value of the column to โ€œReject.โ€

@Dialect_Junk
Try this expression with your Required_if

AND(
	CONTEXT("ViewType")="form",
	[Timecard Approved?] = "Reject"
)

Levent, I tried this expression. It allows me to set the column as โ€œReject,โ€ however, the โ€œReject Reasonโ€ column does not become required as desired.

Screen Shot 2020-01-08 at 8.01.10 AM
If Iโ€™m understanding the expression, itโ€™s saying require this column if the view is a form and timecard approved=reject?

Since the view type is a Detail, I guess it makes sense the column isnโ€™t required since both conditions arenโ€™t satisfied?

Just to clarify, I want to be able to hit the โ€œReject Timecardโ€ action button setting the โ€œTimecard Approved?โ€ column to โ€œReject,โ€ and I want the โ€œReject Reasonโ€ column required if โ€œTimecard Approved?โ€ = โ€œReject.โ€

@Dialect_Junk
I believe itโ€™s not possible to enable quick edit for a required column in a detail view

@Dialect_Junk
I would suggest this:
1.) Create a slice of this recordโ€™s table which contains the [Key Column], [Timecard Approved?] and [Reject Reason] columns only. Set the slice to ADDS_AND_UPDATES mode only.
2.) Add a REF type FORM VIEW and assign this slice as a base table.
3.) Set Finishing View to TASK DETAIL
4a.) Set a Show_if expression like below to your [Timecard Approved?] column

IF(
    CONTEXT("View") = "Your-Ref-Type-Form-View-Name",
    FALSE,
    TRUE
)

4b.) Set an Initial_Value expression like below to your [Timecard Approved?] column

IFS(
	CONTEXT("View") = "Your-Ref-Type-Form-View-Name","Reject"
)

4c.) Set an Reset_if expression like below to your [Timecard Approved?] column

CONTEXT("View") = "Your-Ref-Type-Form-View-Name"

4d.) Set an Editable_if expression like below to your [Timecard Approved?] column

NOT(CONTEXT("View") = "Your-Ref-Type-Form-View-Name")

5.) Re-set the Required_if expression for [Reject Reason] column

[Timecard Approved?] = "Reject"

6.) Change your action button:

Do this > App: Go to another view within this app
Target > LINKTOROW([KeyColumnName], "Your-Ref-Type-Form-View-Name")

7.) And lastly remove [Reject Reason] from Quick Edit


This will simply launch the tableโ€™s Form View with Edit mode, reset the [Timecard Approved?] columnโ€™s and assign the value in the Initial Value property, your [Reject Reason] field will be mandatory to fill in and form saved.

Levent, thank you for taking the time to come up with this! Wow!

I had to roll the app out so I simply changed my โ€œDetailโ€ view to a โ€œFormโ€ view. Iโ€™ll have to try this very clever workaround on the next iteration of my app.

Again, thank you!!!

Youโ€™re welcome

Top Labels in this Space