How to save a new entry ? Before the end of the Form

THTH1
Participant III

Hi everybody,

I am moving little by little, step by step on the App. I was wondering how can I save an entry in a Child table, in both the child Table and the Parent Table. You will see with the screenshots!!

Thanks in advance for your help !


Solved Solved
1 22 2,635
1 ACCEPTED SOLUTION

For what you want to do, you canโ€™t use Finish view. Instead, you have to create an action of type App: go to another view within the same app with a Target expression that uses LINKTOROW() to direct the user to the next page by including the key column value of the row that contains all of the answers:

LINKTOROW([_THISROW], "Etat des lieux - Part 2 (form)")

Once the action is configured, set the Form Saved event action for the form view to the action you just created:

View solution in original post

22 REPLIES 22

GreenFlux
Participant V

If I understand your question correctly, you want to select a parent-table reference in your child-table form, then have other columns in the child-table autofill using related values from the parent, right?

These support docs should help get you started:

https://help.appsheet.com/en/articles/961426-references-between-tables

https://help.appsheet.com/en/articles/1090811-dereference-expressions

The child record is actually saved after the parent record is saved first.

Yes, this is my biggest challenge I think with the App right now.

We need the Data of questions previously answered in the form (child or parent table), in the same form, but just few questions later. For example, if the user fills โ€œI have 7 apple at question 2โ€, we want to say at question 8: โ€œQ8. Since you have 7 apples, then how do you do XYZ ?โ€

You need to play with that columnโ€™s option called โ€œDisplay nameโ€. You can find it from that columnโ€™s definition. You may need to play with the Show? option as well.

Thanks Aleksi for your insights, how ever, I canโ€™t figure out, how to get the number โ€œ7โ€ at the question 8.

Q8 has to use answer from Q2 to ask: โ€œSince you have X apples โ€ฆโ€

Itโ€™s just an example. The real question underlying is: how to save data before the form is ended ?

THTH, Ive had this before and have searched hard and long for a solution. Truth is, I never came to one, its exactly what @Aleksi said, The record is saved when the parent record is saved.

There is no going around this, This is because what if the user cancels the form at the end, than what would app-sheet need to do? Delete all the child records in the form?. Allot of unnecessary reads and writes. (Currently it cancels everything. This is the correct logical approach for child records.)

I ended up restructuring. I think the only reason you need to have this functionality is due to the way you structured your tables.

Is there a workaround in the way your tables are structured? I donโ€™t know the purpose but surly there is. I usually come up with new ideas etc in the Shower.

Steve
Participant V

There is no way to save a multi-page form in the middle of the form, before reaching the last page.

If your all of the form data must be collected in a single row of the table, and you want multiple pages, and you want the form progress saved periodically as the user works through the form, consider creating a slice for each โ€œpageโ€. In the form view for each slice/page, use the formโ€™s on-save event action to navigate to the form of the next slice/page in the sequence.

Thanks Steve, it is clearly the way !!
Iโ€™m implementing the solution. Any idea to work around the system generated action button ?
It automatically redirect to the Table Form but not to the slice/page.

Base the Etat des lieu - All table view on the first slice, rather than on the complete (data) table.

Thanks @Steve

I tried to implement your solution but when I want to save the 2nd slice,I get the following error message: "There is already a row with the key โ€œXXโ€.

Yep, not a surprise, nor a big problem.

Please provide some details about how youโ€™re sending the user to the next page.

I first created 2 slices: Slice 1 for the first 35 column, and Slice 2 for the last 2 column.

Then I create 2 views, one for each slice, and set the finish view of the slice 1 to start the slice 2.2X_d_d996d3acd436c2d77c2f5941819c7fa0cf699122.jpeg 2X_c_cf76cd7fcb461bab9307dcd2377137b8c9f9b5f1.jpeg 2X_b_b93179c39bc909ab16e49e2665b556e4239e9af7.jpeg

Hi @THTH, it seem the same with our last discussion here:

My suggestion, Just try to create similar with that with smaller number of column.

For what you want to do, you canโ€™t use Finish view. Instead, you have to create an action of type App: go to another view within the same app with a Target expression that uses LINKTOROW() to direct the user to the next page by including the key column value of the row that contains all of the answers:

LINKTOROW([_THISROW], "Etat des lieux - Part 2 (form)")

Once the action is configured, set the Form Saved event action for the form view to the action you just created:

THTH1
Participant III

Hi everybody,

I spent quite some time since our last time. I am almost at the end, but still canโ€™t finish due to an error message โ€œThe Main%20Form%20Responses%202 app did not load successfully. Please contact the app creator.โ€ I tried so many things, but keep getting this error message โ€ฆ It happenS when I save a slice to go to another slice/view thanks to your formula Steve (LINKTOFORM)

Screen Vidรฉo

The actions shown toward the end of the video should be using LINKTOROW() rather than LINKTOFORM().

THTH1
Participant III

Canโ€™t believe itโ€ฆ Thanks so much Steve, 5 hours because of a wrong formula โ€ฆ I just changed it as you said, and it works great.

Do you think there is a way to add to the data from Slice 1 to other tables AND go to another view?
I tried to create a group action and then choose it in the form saved action lists from the view form. But I canโ€™t find it.

Definitely! So long as the navigation action is the last action in the sequence.

Unfortunately, I couldnโ€™t make sense your videoโ€“maybe itโ€™s too early in the day and my coffee hasnโ€™t fully kicked in yet!

Important to remember that you can only attach actions to forms that are associated with the table (or the table under the slice) the form uses; you cannot directly attach an action for some other table.

If all you need to do is add rows to other tables using actions of type Data: add a row to another table using values from this row, it should just be a matter of creating the actions like that you need, then create an action of type Grouped: execute a sequence of actions that includes all of the add-row actions.

If you canโ€™t figure it out, please post a screenshot of the grouped-action configuration.

THTH1
Participant III

It was my bad, in the video, I go to the wrong view. Thatโ€™s why I couldnโ€™t find the Group Action.

The action โ€œAdd a row to another table using values this rowโ€ works but the only problem is the following: when adding the values, it will crush existing datas of the current row, even when the column was not mentioned in the action.

Screenshot 1: Action

Screenshot 2: Data crushed from the action

Edit a few seconds later: I just noticed it adds a row, but do not fill the row, thatโ€™s why the existing value (and pre filled calculations disappear). D you think there is a way to fill the row, instead of adding a row ?

@Steve Any idea on that one ?

Thatโ€™s because youโ€™re adding a row (Add a rowโ€ฆ), not updating it. Try using an action of type Data: set the values of some columns in this row instead.

Ok Steve, Iโ€™ll try if necessary. For now, I stopped all perfections and only focus on the basic.
Itโ€™s almost working now, Iโ€™m glad of this new app.

Top Labels in this Space