Fail valid_if

Hi everyone,

I'm having issues with the action's input and email permissions.
I have 2 columns of data and IT Note and Estimated delivery date. For IT Note I check Require but for Estimated delivery date I don't.
And the problem comes from here when the same email but 2 different ones should create a conflict that makes the input input of Estimated delivery date cannot be Saved.
Is there any way to solve this problem? because IT note is mandatory check Require.
Thanks

khangLixil_0-1669187121451.pngkhangLixil_1-1669187144984.pngkhangLixil_2-1669187192619.png

 

Solved Solved
0 26 336
1 ACCEPTED SOLUTION

Ah ha!  The images are helpful.  We didn't previously know how the Forms were being used.

You criteria is ... "when a user taps the IT Reject button and opens the IT Reject Form (or whatever you have called it)  then IT Note is required".  I assume then it is not required at any other time?

In this case, you can use the CONTEXT() function to control under which view the [IT Note] column is required.  In the "Require?" property set an expression like this:

CONTEXT("View") = "IT Reject Form"

NOTE: Replace "IT Reject Form" with the name of your actual Form that has IT Note field.

I hope this finally solves your issue!!

View solution in original post

26 REPLIES 26


@khangLixil wrote:

And the problem comes from here when the same email but 2 different ones should create a conflict that makes the input input of Estimated delivery date cannot be Saved.


Sorry...this doesn't make sense.    And I see no mention of Valid_If??

There is no difference in how the Form is displayed when a field is required vs not required.  The Save button always shows. They behave differently when Save is tapped and they are empty.  If Save is tapped and a required field is NOT populated, the Form will display an error for that field that it is required.

There is no restriction on a field that is not required.  The Form can be saved whether the field is populated or not.

 

The Require unchecked form is not saved because it is related to Require checked data. These 2 data are related to each other because they have the same permissions.

is there any way to fix it?

Thanks


@khangLixil wrote:

The Require unchecked form is not saved because it is related to Require checked data. These 2 data are related to each other because they have the same permissions.


Sorry, still not following what you mean by these statements.  

BUT, if I am guessing, you are saying that the required field is NOT shown and the non-required field IS shown of the Form.  When you fill out the non-required field, you can't save because the required field is not populated.

The fix depends on your needs.  Do you need the required field filled out "now" along with the non-required field?

If yes, then how is it supposed to get filled in?  It has to be either by the user which means it needs to be shown OR it is automatically filled in.  Since it appears to be a "note" field, it seems it should be shown along with the non-required field so it can be filled in.

If NO, meaning the required field is to be filled in later,  there are two options:

  • Set the "Required IF" so that it is only required when certain other fields meet certain criteria.
  • Remove the required field.  You can do this with a Slice.  Create it so it has only the columns you need for this version of the Form.  Then change the Form to use this Slice.  If the required field is not included, then it will not interfere with saving.


@WillowMobileSys wrote:

Remove the required field.  You can do this with a Slice.  Create it so it has only the columns you need for this version of the Form.  Then change the Form to use this Slice.  If the required field is not included, then it will not interfere with saving.


I would have assumed this is not possible. It doesn't make sense to me that a table's row can be saved with a missing required value even if that's via a form based on a slice that excludes the required column. Did I misinterpret your suggestion? If that's indeed possible, again, it seems likely problematic, or at least risky, in some ways but also opens up a lot of flexibility in designing user paths for interacting with data.

Definitely possible.  I just re-tested this to make sure something hasn't changed

I do understand your concern of a column marked "Required" yet left blank on a saved row.  

Thanks for confirming. That seems worth posting a Tip sometime. I could envision saving effort in developing and maintaining some complex Required expressions in a scenario where a row gets processed through various stages, potentially by users with different roles, and different fields are required at each stage. For instance, a support ticket system like the app in this thread seems to be.

how to Set the "Required IF" ? What function needs to be used so that it can understand.
The case of creating a slice like you said I did but it didn't work


@khangLixil wrote:

how to Set the "Required IF" ? What function needs to be used so that it can understand.


You would need to tell us when those columns should be required and when they don't have to be required.  The expression to use will depend on your answer.

 

Figure 1 is that we require require and figure 2 is that we do not require.
Because of these two images, I have the same email permissions, so it can't run when both Require and Not require

khangLixil_0-1669340077767.pngkhangLixil_1-1669340099381.png

 

Ah ha!  The images are helpful.  We didn't previously know how the Forms were being used.

You criteria is ... "when a user taps the IT Reject button and opens the IT Reject Form (or whatever you have called it)  then IT Note is required".  I assume then it is not required at any other time?

In this case, you can use the CONTEXT() function to control under which view the [IT Note] column is required.  In the "Require?" property set an expression like this:

CONTEXT("View") = "IT Reject Form"

NOTE: Replace "IT Reject Form" with the name of your actual Form that has IT Note field.

I hope this finally solves your issue!!

sorry but you seem to be misunderstanding the problem.
my problem is conflict between IT note with require and Estimated delivery date not Require.
If IT Note has require, I have been able to Save but Estimated delivery date not Require is not, because these two data belong to the same email, so it can't check Require and don't check Require.
Do you have a way to Estimated delivery date not Require Save when IT Note requires Require


@khangLixil wrote:

sorry but you seem to be misunderstanding the problem.


That is certainly possible.  

This is what I think is happening.... 

...You cannot save the "Estimated Delivery Date" because you get an error that IT Note is required.   Is this the issue?

If that is the problem then what I described in my last post will work because you are making IT Note only required when on that certain Form and NOT required when on the form that has the "Estimated Delivery Date" field.

If what I mentioned above is NOT the problem then please SHOW us, with images, what the issue is.  

 

You cannot save the "Estimated Delivery Date" because you get an error that IT Note is required.   Is this the issue? => yes bro

but when i follow your way it doesn't show Require sign, i need it

khangLixil_0-1669343614271.png

and

khangLixil_1-1669343756131.pngkhangLixil_2-1669343899740.png

it cannot fit Require and not Require.
You know what I mean?
Thank

Are your "forms" for IT Note and for Estimated delivery date being generated via  INPUT functions associated with your IT Reject and Preparator actions? If so, that likely changes the necessary approach.

yes. When clicking the IT Reject action, the IT Note input will appear.
Do you understand the problem I'm having?

No, I do not yet understand. I'm only trying to home in on the precise scenario.

I suggest you post screenshots of the configuration of each action, along with the details of any expression that includes the INPUT function.

I mentioned above, you can review it
Thanks

@dbaum 

Hmmm!  If you are using INPUT() function, it could be problematic for this scenario.  I think  INPUT() function opens a "generic" Form.  It is given a generic name that maybe you could use in the CONTEXT() function?  You'd have to try it.

If not...

Is there any other criteria on the row you can use to decide when "IT Note" is required?  Perhaps,  a Status column set to "Rejected"?

If not then instead of using INPUT() I would recommend creating a custom Form with just the IT Note field - looks just like the Form present from the INPUT() function.  Then you can use the CONTEXT() function with that view name to control the "Require?" property.

You will need to make sure this new Form does not become the default Form for inserting the row.   AppSheet will pick up the first Form in the view list as the default.  Easily solve by naming the view so it is NOT the first in the list.

If indeed the app is using Data: set the value of some columns in this row actions  and an INPUT function in an expression to set the value of the IT Note and Estimated Delivery Date columns, then another possible alternative might be to introduce a condition in those expressions. For example:

IFS(condition if required, INPUT(...))

Regardless, it's difficult to know what techniques to recommend exploring without understanding better the app's current structure, which is likely best accomplished via illustration using additional screenshots from the app editor showing the configuration of the actions in question.

Thanks for helping me.
I'm going the other way and I have 1 question to ask you.

I replaced the input action with the edit function.
Everything is perfect but when I add 1 data also equal to the actual delivery date eidt, it only receives the first 1 data
I will draw a picture for you to visualize.

khangLixil_0-1669599679166.pngkhangLixil_1-1669599820008.pngkhangLixil_2-1669599918691.png

 

I need a similar form to print ACTUTAL DATE.
Estimated delivery date and Actual delivery date both belong to 1 slide which is Slide Status.

Thanks

 

I'm still not clearly following your app design or use case.

Based on your latest reply, my suggestion is to consider adding the Actual Date column to the Slice_Status_Form and ensure that the Estimated Delivery Date and Actual Date columns' properties have expressions yielding the right combination of Yes/No values for Required, Editable, Show, etc., to provide the behavior you want in each scenario where users can encounter your form.

Both of your illustrated actions are exactly the same - just different names.   The actions simply edits the provided row and will pick up the default Form to do it - which it did in both cases based on what you have shown  There should be no reason to expect them to do anything different.

Since your goal is to have them show different fields to be updated based on the which button is tapped,  you need to control that behavior with specific Forms.  Instead of using the Edit action, create two special purpose Forms - "Update Estimated Delivery Date" and "Update Actual Delivery Date".  Then modify your two actions to "go to another view in this app",  use the LINKTOROW() function and specify the correct Form view for the correct action button.  See image below for an example:

Replace the Edit actions with something like this

Screenshot 2022-11-28 at 12.43.06 PM.png

 

 

Thank you very much, I did it successfully.
Can I ask you 1 more question?
I want these 2 actions when printing itself, it will also disappear

khangLixil_0-1669685591049.png

 


@khangLixil wrote:

I want these 2 actions when printing itself, it will also disappear


When "printing" itself? 

It is common to "hide" action buttons for any long running activities such as producing a report or actions that are meant to be a one time occurrence such "Mark Complete".  In this case, I don't see that you need to "hide" the buttons. 

These actions, as I understand it, are each opening a Form view.  A user MUST either Cancel or Save the Form BEFORE they can do anything else.  They cannot come back to the view and tap another button while the Form is open.  Once they cancel or save, I imagine you want the buttons to be available again?  If so, then there really isn't any need to "hide" these buttons.

Is there more to it? 

 

As you said, when the 2 action buttons I mentioned above need to be hidden once it has been pressed.
When finished, the action button will hide and no longer appear instead of the corresponding action buttons.
How can I do that, I'm having a hard time with these 2 action buttons because it only input the date and I can't set the event to hide.

khangLixil_1-1669770958307.png

khangLixil_2-1669770999278.png

 

 

You "hide" the buttons using the "Behavior" section in each action - see image. 

Insert a YES/NO expression.  Yes to show the button, no to hide it.  What that expression is I can't say because I don't know all of your data and I don't know why you need to hide the buttons to begin with.

Screenshot 2022-11-30 at 12.49.16 PM.png

 

Top Labels in this Space