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

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 !


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

1 Like

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

2 Likes

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.:slight_smile:

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.

2 Likes

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”.

1 Like

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.1 Slice 2 View slice 1 3 View slice 2

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:

1 Like

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().

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.

1 Like

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! :slight_smile:

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.

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 ?