Dependant Enum values

Hi,

I am having an issue that I am having trouble with which I would like some help.
I have a Enum field called “Status” with the following enum values (Non Initiated, Initiated, Terminated, Suspended, Paid). I would like the user to be able to select the 4 first values Non Initiated, Initiated, Terminated, Suspended) and the last one (Paid) to be dependant of another field called “Date of Payment”
So basically once “Date of Payment” is inserted than “Status” must be Paid no matter the previous selection.

can you guys help me to make this work?

1 13 615
13 REPLIES 13

Steve
Participant V

For the Valid If expression for the Status column, try:

IF(
  ISNOTBLANK([Date of Payment]),
  LIST("Paid"),
  LIST("Non Initiated", "Initiated", "Terminated", "Suspended")
)

Thanx for your input.

it almost worked, when I check the table (google sheets) it doesn’t record “Paid” on the column “Status”
It lists it but then it needs a click in order to make it active.

That is not the desired action… I want the the option to be selected… not listed

Hi @Luis_Gomes_Machado,

Based on your latest input that you wish the status to be auto populated with “Paid” status when the [Date of Payment] column isinserted, you may wish to consider following approach to add to the guidance already by @Steve. This approach will work if the app user needs to open the corresponding record form to update the date of payment.

The valid_if of status column is as per guidance given by @Steve

You may consider an action type “Date : Set the values of some columns in this row” to change the value of column Status to “Paid”. This action may be set to “Do not display” option.

The condition to run this action may be ISNOTBLANK([Date of Payment])

This action can be set as an event action on form save option on the view settings pane of view “Actividades por Obra_Form”

Finally the editable_if condition on status column could be AND(ISBLANK([Date of Payment]),[Status]<>“Paid”)

Hope this works and helps.

ohhh man you have no idea how it helps… I am so thankful for you guys that take the time to help me.

I was able to do everything on the list of tasks that you gave me but one:
This action can be set as an event action on form save option on the view settings pane of view “Actividades por Obra_Form”

I dont know where to do this…
The table of “Actividades por Obra” has the following views:
Primary Views
“Estado de Actividades” (Activities Status in english) which is a chart
“Actividades” which is a table
“Dashboard” which is a dashboard view obviously
Menu Views
“Actividades por Aplicador” (Activities per employee) as a table
“Actividades por Corte” as a deck
“Areas m2” as a table
“Cortes de Obra” as a table
“Priority” as a table

these are the views I have so I don’t know where to find “form save option on the view settings pane of view”

Hi @Luis_Gomes_Machado,

I believe “Actividades por Obra_Form” should be a system generated view. Please click on the “Show System Views” ( This option is at the bottom) under UX - > Views and then you will get to see the view "“Actividades por Obra_Form” .

In this view’s settings, please select the newly created action under the option “Even Action” under “Form Saved” sub option.

Thanx again!!!

I’ve finally completed all the steps and it didn’t work

can you think of something else?

Could you explain how it didn’t work? Is something blank that shouldn’t be? Is some value wrong? Is there an error message?

well no action happened and the previous selected enum value staid the same

I dont mind to share the app and the sheet with you guys, if you want
but please tell me what its needed to make this work as I need to learn

Hi @Luis_Gomes_Machado,

Could you please mention, how the date of payment is populated by the user. The suggested logic assumes that the date of payment column is a real column and it is blank till the user populates it. Does the date of payment column have any initial default value?

Also the action takes place only after the form is opened and saved. Thereafter the status will get locked to “Paid”. If you have any existing records that are previously created, the status will change to paid only after the record is opened, date of payment is populated and record saved.

Thanx again for your time.

The date of payment is populated by the user through a different table called “Corte de Obra”.
This table handles activities, An invoice is generated by a group of activities that is executed between a specific time frame which we call (Corte de Obra).
This Corte de Obra has a specific table with its columns like “Corte de Obra ID” and Corte de Obra Number" as well as “Date of Payment”, each row input to this table referes to a group of activities on the table previously mentioned “Activities”. Once you set the date of payment in Corte de Obra, I have a formula in google sheets “=if(NOT(W2=”"),VLOOKUP(W2,‘Corte de Obra’!$B$2:$N,13,FALSE))" that pulls this record into the activities table to a real column named exactely the same “Date of Payment” in every activity that is related to Corte de Obra, so I can create format rules depending on the status of the activities: “Non Initiated, Initiated, Terminated, Suspended, Presented for payment, Paid”

I have considered what you mentioned as the input was populated from a different table and by a different user and I edited the activity and clicked on save to see if the status changed, but it didnt

Hi @Luis_Gomes_Machado,

You may wish to take a look at a tiny sample app that I put together at the following path.

Here the "final"status is “Accepted” that is automatically set when the [Date of Acceptance] is populated. I also added a VC [Status V] to take care of period before the form is getting saved. The real column gets updated only on form save. Till then the Status VC provides the updated status in the form view. Hope this helps in some way.

Conditional Status Update

I love how this work !! and it is exactly how I need

please refer to my other reply ti understand throughly my problem

Top Labels in this Space