How to pass values to a system view form

I have 3 tables: Service Calls, Customers & Sites.

In Service Calls table there are several columns two of which are [Customer ID] & [Site ID]. Both are references to the respective tables.

Sites has the column [Customer ID], it is also a reference to the customer table.

When entering a new record in to the Service Calls form I select a [Customer ID] from a drop-down. Next I can select a [Site ID] from a drop-down. The drop-down options for [Site ID] are filtered to only allow choices of sites that reference the selected customer.

All is good so farโ€ฆ

When I need to add a site that does not yet exist I choose โ€œnewโ€ from the [Site ID] drop-down. This opens a form for a new row in the table Sites.

On this form the [Customer ID] field is blank and I need to select the [Customer ID] again. How can I pass the value of [Customer ID] from the current row of Service Calls to the new site form so it is not necessary to choose the customer again?

1 16 1,955
16 REPLIES 16

As you have a REF, you can use a de-ref expression in your Initial Value

Thanks for the quick reply.

Is there any chance you can be more specific? Everytime I try to dereference I get a nothing value (i.e. The Customer ID field in the new Sites row will be blank.

I think the issue is that I get half way through the Service order entry form and then I have to add a new site. For what I can tell no row has been added to the Service Calls table by this point.

@Donato_Speidel
You can read more here


Thanks again for the response. I have read both articlesโ€ฆ multiple times and I just read them again. Is there any specific section that I should narrow in on? Because nothing is jumping out at me.

Iโ€™m not sure I am explaining my issue very wellโ€ฆ

When I create a new entry in the Service Calls table, sometimes I need to create a new Site.

The Form is set up such that the Site column will not display until a Customer is selected.

In some instances I need to add a new site because it is not already added to the Sites Table and associated to the currently selected Customer. (keep in mind this is all entered in the Service Calls form at this point)

The way I do this is I select the Site column (on the Service Calls form) and choose โ€˜Newโ€™ from the drop down list. This will take me to a different form automatically. (I do not believe that any of the information previously entered in the Service Calls Form has been saved in a table at this point.) This form is the Sites Form and it is intended to create a new row in the Sites Table.

One field in this new form (for Sites Table) is Customer. In both the Service calls Table and the Sites Table the Customer column is referencing the Customer Table.

The Sites table does not Reference the Service calls table hence why I am asking how to send data rather than how to reference data.

I have not come across anything on how to modify the behavior of the โ€˜Newโ€™ option in a reference drop down listโ€ฆ

@Donato_Speidel
Advise checking out this post from @Steve

Thereโ€™s really no easy way to do this.

Never mentioned using any inline views.

Thanks Steve,

Is this a limitation of Appsheet or poor app design?

Not necessarily either - itโ€™s more a bug really.

I remember when they first introduced that ability (to add a new reference while filling out the form); there was intention to try and fill as much as possible from the form you previously came from.

But over the years things have evolved into a more โ€œstandardized system of processesโ€ and this has resulted in that behavior not functioning that way anymore.


My solution to this problem is to change the interaction method; instead of doing things through the form, see if you can find a way to do everything outside the form for the most part - using actions.
There are plenty of times when youโ€™ll need to migrate into the form to capture some data, but there are other times when using the detail view (with itโ€™s inline views) along with actions can really change the interaction flow.

If you were on the detail view of your โ€œnew recordโ€ with an inline view of all the related sites, then you could just press the system generated โ€œaddโ€ button to add a new site - or use your own custom actions to accomplish something using LINKTOFORM().

Hello,

Iโ€™ve been struggling to find an answer to this problem, and my long searches have yielded none!

I really donโ€™t get it, why a simple value-passing feature is impossible? On one hand, it is already there when you open a Form from an inline view, you get the form with the referenced values already in place. Why canโ€™t appsheet users just copy this action and use it?

On the other hand, โ€œadd a new row to another table using values from this rowโ€ seems promising. However, first you should know in advance the values of all the other columns in this row since there is no way to launch a form for the user to fill in the remaining values, and second, if you have mandatory fields in that row, then you get a runtime error that brings down the whole app altogether.

The workaround I devised to have this achieved is to create a new table and use it as a cache file to hold temporary column values that can be referenced by (passed to) other tables.
Bots, or actions attached to forms upon saving can fill that cache table, the temporary column value has its place in the referencing table, and formulas in the other columns can make use of the passed value.

Perhaps there is a simpler solution, or may be I completely missed the point, so feedback is welcome and help is appreciated.

Thanks,
KJ

You can create it manually, which is better from my POV. I can have a LINKTOFORM() from any corner of my app to open the form I want with the Ref I want.

What are you struggling with?

Thanks for your reply. Letโ€™s say we have two tables, Orders and Transactions. One order will have one transaction of a type โ€œPaymentโ€, while a transaction can be of many other types and origins other than Orders.

The table Orders, have a reference column to Transactions. The user begins in the Orders_Form, filling the details of the order, then upon updating the Transaction field he is invited to create a new Transaction and is transferred to the Transactions_Form to fill in other details about the transaction (columns of the Transactions table).

There are several columns in the Transactions table that should be filled automatically. The transaction type should be set to โ€œPaymentโ€ for example and a couple more should be calculated based on the values of other columns in Orders.

This is what Iโ€™m trying to achieve.

Just a quick note on this:

  • Youโ€™ll be better served NOT using sub-forms (if you are)

(Sub-forms are โ€œforms within formsโ€ - they tend to be prone to errors and bugs; best not to use them, and instead use Actions and View Events to handle all this. Down side: you have to build all this out. The sub-form thing is a good idea, itโ€™s just thereโ€™s so much complexity built into the system that itโ€™s nearly always broken.)

Unfortunately I am. Iโ€™m building the app for an organization comprised mostly of non-IT-skilled personnel, and the UX design was based on the premise of maximum automation and minimal user interaction, so that the organizationโ€™s many work processes are controlled and implemented by the app to the maximum extent possible rather than by the personnel.

Your advice however is a much appreciated heads-up!! If sub-forms are that prone to errors, then Iโ€™ll steer away and work rather on integrating alternative off-form controls.

Thanks much!

P.S. Is there a stable way to integrate a JS/GS code into an appsheet action button please? Thanks again!

You canโ€™t use custom code inside appsheet; but everything youโ€™re wanting to do is possible, you just have to build out more stuff inside appsheet in order to make it work.

  • Actions, virtual/physical columns, possibly additional tables, etc.

Thereโ€™s typically much more involved in getting something smooth than one would assume.

I like that !

Thanks for your help.

Top Labels in this Space