Call form to update record based on value in another table

I have a table, INSTALLATION DETAIL, referencing the main table, JOBS through jobID.

Currently, the form for inserting information in the INSTALLATION DETAIL table, runs a "Data: execute an action on a set of rows" with target: SELECT(Jobs[JobID], [JobID] = [_THISROW].[JobID]), and references an action, JOB PICTURES,  "App: go to another view within this app" with the target: LINKTOROW([JobID],"Job Pictures") to call the Job Pictures form.

This works fine for one Installation type, but I want to call different forms to update the records in the JOBS table based on the installationType in the INSTALLATION DETAIL.

I found a post explaining LINKTOVIEW(SWITCH( )), but I think that's when the information to update is in the same table. 

 

0 7 185
7 REPLIES 7

Steve
Platinum 4
Platinum 4

I'm not entirely clear what you're trying to do. Could you explain in plain language (not using AppSheet terms) what the user experience would be?

Hi @Steve , thanks for the reply. 

The user selects has a list of jobs that is in progress. When he clicks on the record, he is taken to a form where he needs to add some detail of the job he just completed. This information is savend in another table, "Installation Details", joined by the JobID in the Jobs table. One of fields in the Installation table is a TYPE of installation. By saving this form, based on the TYPE, another form should open, for entering more information in the Jobs table.

Reading this, it also sounds like a complete mess.

Let's see if I understand:

  1. User visits list of jobs in progress.
  2. User click on a job-in-progress from the list.
  3. App navigates to a form view to add a new Information Details row that is a child of the job-in-progress the user clicked on.
  4. User completes the Information Details form and clicks Save to add the new row.
  5. The Information Details form view is configured with a Form Saved event action to navigate to another view that corresponds to the job type of the job row the user clicked on initially (in (2), above).

You need help with (5), yes?

@Steve Yes, something like that. 

I have now managed to get it to work, but not correctly. 

So the user click on a job in view. This brings him to a form to upload some images. On the Form Save, it opens another form (filtered through a slice) where the user selects the Job Type. On the form Save, depending on the type of job, it calls yet another form (Also filtered through slices) through an action: effect: App: go to another view within this app with the following target:

IFS([_THISROW].[Installation Type]=โ€œATBโ€, LINKTOFORM(โ€œATB Installation Detail NEWโ€, โ€œ InstDetailIDโ€,[InstDetailID]), [_THISROW].[Installation Type]=โ€œOFBโ€, LINKTOFORM(โ€œOFB Installation Detail NEWโ€, โ€œ InstDetailIDโ€,[InstDetailID])) 

It seems to work except that it now creates 2 records in the table. 

Are the slices both using the same table the first view uses?

@Steve , Yes they do. The table has lots of columns, but I use the slices to filter out different columns to be populated based on whichever view is used. 

LINKTOFORM() will always add a new row. You'll need to use LINKTOROW() instead.

LINKTOROW() - AppSheet Help

Top Labels in this Space