I’ve been banging my head against this and can’t seem to make it work…
I have a situation where I want users of the app to be able to add questions to a specific topic. So the users would add questions in the app, and those questions would then get added to an array or set on the topic row in the topics table. So either, I need an infinitely expanding table, or need to add these to an existing array column for each topic when they ask the question through a form field. Everything I’ve tried so far has just added a new row to the table instead of adding a new item in the array/set. Help!
Follow up attempt here… I added a new table called questions, and trying to add an id field that links back to the topic on each question so I can just run a filter on each topic to show questions just based on that topic. However, on the form action it just allows me to set column values for “userProfile” or “This Item” and the item it refers to is the question table instead of the topic table, so I have no way of setting the topicID field on the question to the id of the topic. Is there a way to inject the context of the topic from that page into a form container that is targeting the questions table?
I think you’re close here. If you open the form from the topic screen, and writing that to the questions table, you would have access to that topic’s ID on “this item”? Can you show us how you’re configuring it?
So when I open the form on the topic’s screen I set the destination on the form to the “userQuestions” table so it will add that question to that table. When I create an action to “set column values” so I can set the topicID to the question, the “this item” row that it is referencing is the “userQuestions” table, not the topics table, since I set that as the destination for the form. It doesn’t seem to inject the context of the wrapping screen into the form since I’m setting the form destination to be the userQuestions table
Why do you need to create an array in the Topic table? Couldn’t you just write the Topic ID into the row added to the Question table and then create a relation linking the Topic table to the Question table using that ID? If you still want an array, all you would need is a lookup column that references the relation.
Yeah I kinda scrapped that first question/thought I had regarding the array and started pursuing the second option. My problem now is that I can’t write the topicID into the row in the questions table, because I can’t access the topicID from the form that is writing a new row in the questions table
If the form is opened from the detail screen of the topic, it should be as simple as adding a Value component that passes the topic ID through the form.
That would be great, how do I do that? Does it have to be from the detail screen of the specific topic? Right now it’s on the detail screen from the “all topics” page, so when you click into the specific topic the form is on that page, but I can’t see it. Do I need to create another hierarchical level and go into a deeper detail page of that topic, or just add a hidden field to the form container with the id of the topic?
This is what I don’t get… I added a text field to the top of the form container, and for the text content inside that form container, I get full access to the topic data including RowID for the topic and the name. However, when I go to the “after submit action” for the form container, I lose access to that topic data to set a value based on the topic ID…
Holy hell, that was waaaay easier than I thought… Definitely unclear as I’m trying to figure this all out based on a “submit action”, but just using the “additional columns” field in the sidebar for the forms container, I can just directly set the topicID into the related field on the userQuestion table. Wow, super easy, but definitely not straightforward
Oh, so you are using a form container instead of a form screen. In that case, yes, you need to set the appropriate Additional Value parameter in the right hand panel when the form container is selected.
In short… If it’s a Form Screen, you pass values through the form by adding Value components. If it’s a Form Container, you set the Additional Values on the right.
Don’t bother with On Submit for something like this.