Detail > Form, input validate

Hi guys,

Im trying to figure out how to make a form input validation when you come from a “detail view”, here is a better explanation about what I want to do.

3X_e_f_ef52270a6074841707b7951c378664365626f98a.png

I was trying to play with some ideas, but if I want to do it from the form view "it doesn’t has an (valid if), just a (show if) field, and tried directly with the behavior action, which contains a (valid if), with the next formula:

[_Thisrow][keynumber]=tableA[keynumber]

But it says the next message:

Cannot compare Text with List in [_Thisrow][keynumber]=tableA[keynumber]

Somebody knows a better way to do something like this?

Thanks in advance guys.

Solved Solved
0 26 414
1 ACCEPTED SOLUTION

Hi @Tovarsho ,

Not sure what you are attempting. Could you please update what is the field Delivered[trackingnumber_validation] in the LINKTOFORM action?

I think your LINKTOFORM() be simply

LINKTOFORM(“Entregados” , “trackingnumber_validation”, [trackingnumber])

where “trackingnumber_validation” is the column in the “Entregados” form and [trackingnumber] is the column in the source table where the detail view is based on. ( new_buy)

View solution in original post

26 REPLIES 26

Hello @Tovarsho, i’ve gotta ask, why do you need to validate a key number?

If you were able to go from A to B, that is proof that the “key number” is the same, and if it was saved using the good ol’ UNIQUEID() expression, it’s also safe to assume that it is unique.

[_THISROW].[keynumber] returns the “key number” belonging to a single row in your table B

tableA[keynumber] returns a list of all the “key numbers” from your table A

So just like the warning says, you can’t compare a text with a list in that way, if you want to know if the “key number” of a row in your table B exists in your table A you can try this expression:

ISBLANK(INTERCEPT(LIST([_THISROW].[keynumber]),tableA[keynumber]))

TRUE is returned when your “key number” doesn’t exist in table A
FALSE is returned when it does exist

You can reverse this logic by using ISNOTBLANK() instead of ISBLANK(), it’s personal preference.

Hi Rafael,

Thanks for your quickly response.

I’ll give you an life real example for this case:

Somebody ask you to buy something in a shop, and gives you the code (the keynumber in this case) and table (A), then you go to the shop, search for the product and put it in to the field “Keynumber” from table (B).

So I want to validate, if the given keynumber from table (A) in the detail view, is the same on the input in the table (B), to confirm is the same product that somebody ask me to buy in the shop.

I don’t know if is a better explanation. Just in case, it doesn’t need to be a keynumber, it can be the name of product, or the quantity of products etc.

Thanks in advance

Well, that’s the thing, you don’t need to validate that it is the same product using the key number because you wouldn’t have been able to find the product itself if you were not using that key number.

When you move from A->B using an action you’re already working using the information that there’s a key number common to both tables, and this information is available to you when you utilize an action to do so.

If you want to validate BEFORE attempting to move from A to B in order to hide an action button or something like that, then I believe the expression I posted in my previous answer might work for you.

If you find yourself in your table B and need to know more about the rows of table A who are assigned some of the rows of your table B, then what you need is a reference between the tables.

I might be wrong, of course, and I just might not understand what you’re trying to do, and that’s okay.

The question is, does my expression work for what you’re trying to do?

Well, I think it won’t work, because I don’t want to validate if EXISTS, I want to validate if is THE SAME from the previous table and view.

Possibly I’m a mess trying to explain it, It attached a better example (I guess):

Let me know if something change from my previous explanation.

Thanks in advance once again

Please, who can help me with this? I have been searching the whole day, but not success

Could you please add what type of action you are using?

Hi Suvrutt,

It is not an action specifically, it is a form in which I want to do the validation before the information is saved after pressing the “SAVE” button.

I can’t manipulate that “SAVE” action as far as I know.

I mean what action you are using to navigate from the detail view of new_buy to form view of on_process , the action “Go to buy”

Oh, sorry, didn’t understand before.

This is the action a (linktoview) one.

Oh okay, thank you. Could you please try LINKTOFORM() instead?

Sample app

Your syntax could be something like

LINKTOFORM(“Entregados”, “Product_ID”, [Product_id], “Price”, [Price], “etc”, [etc])

Please note these ( “Price”, [Price], "etc., [etc]) columns names are just examples, please use whatever you wish to pass from new_buy record to on_process form during this navigation.

Jesus Christ, I never would have imagined, I’m gonna check right now and come back with news, thanks for your support Suvrutt!

Suvrutt, I have news.

Is totally linked now BUT, the field automatically comes fill after go to the form, also it let me put another product_id <> to the previous one (that one where I came from).

The idea is that field keeps “empty” when I enter to form an scan a code (which should be the same from the details view)

Oh okay, that is interesting requirement.

You could make the Product_Id field’s editable_if constraint FALSE so that app user cannot edit it.

The following suggestion is not tested but you could give it a try.

Please create another column in the table on_process called say [Product_Id_Validation] . Make this column hidden ( Show_if set to off)
From the LINKTOFORM() action, please populate [Product_Id_Validation] with the [Product_Id] from the new_buy table.

In the valid if of the [Trackingnumber] column in the table on_process put the condition [Product_Id_Validation]

Let’s check it out!, be right back.

I got the next error on table on_process.

Column Name ‘Trackingnumber’ in Schema ‘on_process_Schema’ of Column Type ‘Text’ has an invalid data validation constraint ‘=[product_id_validation]’.

I don’t know if this is because that field is a key?

Have you put in “=[product_id_validation]” ? Please put only [product_id_validation]

Tried both of them an got the same error

Im gonna show you the images (maybe will be confuse for you because now Im gonna show the real names of tables etc):



Hi @Tovarsho ,

Not sure what you are attempting. Could you please update what is the field Delivered[trackingnumber_validation] in the LINKTOFORM action?

I think your LINKTOFORM() be simply

LINKTOFORM(“Entregados” , “trackingnumber_validation”, [trackingnumber])

where “trackingnumber_validation” is the column in the “Entregados” form and [trackingnumber] is the column in the source table where the detail view is based on. ( new_buy)

Hi Suvrutt,

Table (new_orders), table (delivered)

In new_orders:

  • trackingnumber (field) “this one has info”

This new_orders table has the information of a buy (which has the product information, tracking number. etc)

In delivered:

  • trackingnumber (field) “this one is empty and I need to fill it trought the form”

  • trackingnumber_validation (field) “this one you ask me to create”

This lastone table has the FORM, which I need to complete, and fill the “trackingnumber” field, but this trackingnumber field SHOULD be the same trackingnumber when I came from the detail_view from the new_orders information.

I don’t know how to explain it better, sorry

Please create

  1. LINKTOFORM(“Entregados”, “trackingnumber_validation”, [trackingnumber] )

  2. In the valid_if of [trackingnumber] in the delivered table , please have [trackingnumber_validation]

I did it exactly as you ask, but got error, I think because the field is text?

What is the TrackingNumber_Validation column type?

valid_if needs to be

[_THIS] = [trackingnumber_validation]

Is TEXT, just the same as trackingnumber field

Okay yes, please use Marc’s suggestion. Thank you Marc.

Jesus, finally, thank you guys so much, I really apprecciate the help you gave to me, just let me know if I can help you with anything, count on me.

It worked!

PD: We can donate as user to other user or to appsheet directly?

Thanks!

Top Labels in this Space