Hello,
I have created a simple app that has a โMealsโ table in Google Sheets and an โAdditionsโ table in a second tab in the same sheet. The โAdditionsโ table has its own Key column which is initialized with UNIQUEID() and a โMealโ Ref column that refers to the โMealsโ table. Note that the โMealโ Ref column is not shown.
When using the unpublished app, when I use the โAddโ link to add a new โAdditionโ to a โMealโ, more often than not, the new โAdditionโ appears in the list of referenced rows, but when I press the sync button, the row vanishes. Looking at the data, the โMealโ column is not populated.
Any ideas why this may be happening and how to fix it?
Thanks
Miles
Hi Miles,
Do you have โis a part ofโ turned on for the โMealโ Ref column in the โAdditionsโ table?
When you turn โis a part ofโ on, it allows you to add new line items to that table (โAdditionsโ table in this case) while completing the referenced form (โMealsโ table in this case).
From inside the form view for โMealsโ, when you click โAddโ, it will bring you to the form view for the โAdditionsโ table. After completing the โAdditionsโ form, you click โSaveโ and it brings you back to the โMealsโ form. From there, you can click โAddโ again or continue with the rest of the form. At the end of the โMealsโ form, you click โSaveโ and the changes will sync back to the data source.
Important: The items you add to the โAdditionsโ table will not be synced back to the data source until you click โSaveโ on the parent tableโs form (โMealsโ in this case).
So my first guess is that you may be pressing the sync button before completing the โMealsโ form.
Another good thing to check is the referenced table for your โMealsโ Ref column.
*Go to Data > Columns and click to expand the โAdditionsโ table.
*Click the edit pencil next to the โMealsโ column
*Check that โSource tableโ is set to โMealsโ
Cheers,
Derek
Hi Derek,
Thanks for the prompt suggestions.
Populating the โMealโ column in the โAdditionsโ table used to work, but it does not seem to work now. I have now enabled the โis a part ofโ setting for the โAdditionsโ table and confirmed that the โMealโ Ref column has its source set to โMealโ, but this still does not seem to work.
Might it matter that I have manually edited the sheetโs data (i.e. does AppSheet try and remember state about the underlying spreadsheet and it may be getting confused)?
Miles
Unlikely.
Please post screenshots of the column lists (from Data >> Columns in the app editor) for the two tables. Letโs start there.
Attached are some images for you to look at.
As I am a new user this will take three postsโฆ
Might it make sense to share the app with you and Derek?
Meals columns:
Additions columns:
Meal Ref column details:
How are you adding an Additions row when it doesnโt work as expected?
Yes. Using the โAddโ link under โRelated Additionsโ. The sequence is:
An additional possibly important point:
The โMealโ sheet is in the same Google Sheet as the โAdditionsโ sheet, but a different tab.
Please post a screenshot of the complete App formula expression for the Related Additions column.
Thatโs typical. Not a problem.
App formula expression for the Related Additions column:
That looks correct.
Is there a Spreadsheet formula configured for the Meal column in the Additions table?
Is Editable? set to ON for the Meal column in the Additions table?
Have you added any actions (via Behavior >> Actions) to your app? Or made changes to any of the system-generated actions?
Do you have any workflows (Behavior >> Workflows) or reports (Behavior >> Reports)?
There is no โformulaโ values for any field in the โAdditionsโ table.
The โKeyโ column has an initial value formula of UNIQUEID().
Ah ha! That was it. I set Editable? to ON and it started working!
I probably turned this off at some point, because I did not want an โAdditionโ to move between โMealsโ (before I set Is a part of? to ON).
None added.
None added.
Thanks for all of your help Steve.
How would a developer identify this issue without this kind of support?
Miles
Iโm glad you were able to find the culprit. Steve is in fact an AppSheet Jedi!
There is a team of people whose goal is to make the AppSheet learning curve as easy as possible, but sometimes youโll find things like this that take some experimentation.
Everyone has their favorite resource. I always like to start from a working example of something similar. For that, there is a collection of free sample apps you can copy to your account. Iโll often compare what Iโm working on to the sample app and try to find the differences. And of course your community is here as resource as well.
User | Count |
---|---|
39 | |
35 | |
29 | |
23 | |
18 |