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.
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! Go to 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)
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:
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
LINKTOFORM(โEntregadosโ, โtrackingnumber_validationโ, [trackingnumber] )
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!
User | Count |
---|---|
38 | |
34 | |
27 | |
23 | |
17 |