Fill forms details according to the value in the first dropdown

Hey
I have ORDERS table and ORDERS FORM
In the Order form after the i choose the Customer Name from the dropdown
I want to run a test on the ORDERS table if this customer already payed for the class
If he already payed i want to fill in all the details of his payment like INVOICE NUM, the number of Class that he payed for, and the END DATE of his purchase โ€ฆ That i already enter the first time he did the payment
My idea was to run a cheack using this expression

MAX(SELECT(PaymentsRec[End Date],[Name] = [_THISROW].[Name])) >=Today ()
If that expression is TRUE
I though that i need an action LINKTOFORM that reopen this form with the all the details i need
If that the way to do it how i built it?
How i say to appsheet to run a test and trigger the action and fill in the form with the rowโ€™s details ?

Solved Solved
0 5 465
1 ACCEPTED SOLUTION

The Virtual Column to capture the row id is an excellent, excellent idea!!

To simplify even more you can use dot notation to reference columns of that row. For example, your IF statement can now be this:

IF([SubType]=โ€œpaidโ€, 
     [LastPayKey].[PayType],
  "")

For the other columns you want to populate, you can do this as well:

[LastPayKey].[Invoice Num]
[LastPayKey].[End Date]

View solution in original post

5 REPLIES 5

I am understanding that you want to open a new Form and populate SOME fields from a previous paid order. NOT that you want to โ€œopenโ€ and look at the previous order details.

If I understand this correctly, then please read on. Otherwise, please re-post to clarify.

There are a number of ways to handle this. To make it less complicated for app users, my suggestion is to place an IF() statement in the Initial Value of each field that you want to populate with the previous order info. Something like:

IF(<Previous Order exists>, <Value from previous order>, <Initial Value>)

Since youโ€™ll need the Customer info for the expression to find an order, the fields will all start with the <Initial Value> until you fill in Customer.

If you then do not want to allow these values to be changed when a previous order is pre-populated, then you would use the Editable_If property and implement a similar IF() statement:

IF(<Previous Order exists>, "FALSE", "TRUE")

The expressions you place inside the IFโ€™s might be a bit complex but this is certainly doable and more seamless to the users than any other approach.

I hope this helps!!

@WillowMobileSystems
Tnx for u answer you understand what i want
But after i tried to do what u suggested
IF (
MAX(SELECT(PaymentsRec[End Date],[Name] = [_THISROW].[Name])) >=Today(),
ANY(
SELECT (
PaymentsRec[PayType],
AND ([Name]=[_Thisrow].[Name],[End Date]>=Today() )
)
)

," "
)

i though of another way to accomplish what i need, instead of writing everything field very long if condition i made a virtual culomn [LastPayKey] that store the rowโ€™s id that i need
And in every field i wrote something like that

IF([SubType]=โ€œpaidโ€,
ANY(SELECT(PaymentsRec[PayType],([key]=[_THISROW].[LastPayKey]),TRUE))
," ")

What do u think?
Again tnx

The Virtual Column to capture the row id is an excellent, excellent idea!!

To simplify even more you can use dot notation to reference columns of that row. For example, your IF statement can now be this:

IF([SubType]=โ€œpaidโ€, 
     [LastPayKey].[PayType],
  "")

For the other columns you want to populate, you can do this as well:

[LastPayKey].[Invoice Num]
[LastPayKey].[End Date]

@WillowMobileSystems
Tnx very much that was Great team work i Will try it laterโ€ฆ
Iโ€™m a beginner with all this apps writing
Actually im a dance teacher who like technology
So i found out about appheet while i was searching for solution to my class Registry
I have another question for uโ€ฆ I want to have one app that im working in the classes and copy for developmentโ€ฆ Do u know h
How or if i can update the app the im working in classes with the last updates that im doing on the one than im developing?

I asked that same question over a year ago. Below is a link to the response I received. I have yet to try this out.

Top Labels in this Space