Add record and then allow user to edit

I have a unique action that works if they selected a city on the prior screen. But if it takes the “else” branch, I want to add a record then take them to the screen to EDIT the chosen city.
But when it goes to the edit screen, it brings up the record that was pointed to BEFORE the add record. How can I allow them to edit the added record?

image

You can create a column to get single value and get the last row added in the sheet… make sure you put the user id and create relation to fetch the last row of the user and not the sheet.
Then using the single value row as item to edit in show edit screen

So, if I am following you, I add a single value to the user record to get the last Row ID from the Records table

Then how do I configure the Show Edit Screen to edit the last added record? It still brings up the record pointed to prior to the add record action…

image

I tried creating a relation in “Records” like this:

image

And then the “show new” using the relation. But the show new screen never comes up…

image

First you need to have a relation from the Users table that only takes into account records for each user, assuming you capture their email/ID in the records table.

Then, add a single value column on top of that relation, choose last and “whole row”.

You should be able to choose to edit that single value “whole row”, but I’m not quite sure if the row will be created in time for the combo action to work.

The record comes out blank. Seems to me this should be easy for Glide. What I’m going to try (later today) – I already have a “default record”. Instead of trying to add a record and let them modify it, I am going to let them modify the default record by choosing (in this case) a city. Then I will use “add row” to create a new “default record”. This will work in this case, but won’t work in the case that data would need to be keyed in rather than be selected from a drop down.

May I ask why do you want users to edit a record right after they created it though? Won’t it just drive them from the form to the edit screen, which basically can look the same?

Because they are not creating the record. What I want is to add a record with a supplied date, time, Row ID and other default values, but let them change ONE thing. The solution, although convoluted is to use Add Row and let them modify it. What would be better, but is not possible, would be to bring up the Edit screen with default values and let them change only the city – no new row having been created, and they can cancel the whole process. Show New Form just brings them to a list of Records to be edited. Not what action I expected from THAT.

Why don’t you just add a form with the default values for the fields you want to default, and add entries for the field(s) you want them to edit?

You can add default values for a lot of components in the form, say text entry, number entry or choice.

Because it requires them to do something (confusing). Your suggestion may work if you tell me HOW to use the “new form” and actually take them to a form where they enter values, and I’m able to select defaults for most. Right now, if the action is “new form”, it just brings me to a list of ALL the items in “Records”. And they have to click “add”, which does NOT allow me to set defaults.

A form does allow a user to enter values as well as set defaults and automatically pass through column values from the parent record. I guess I don’t understand what you mean when you say that it takes them to a list. You are using the ‘Show Form Screen’ action, correct?

1 Like

No, I had not tried that, but what do I select? It only allows me to change the title, and when I run it, it comes up with that field as the title, and only allows me to change one field…

I had tried Show New Form, but that shows the last record that had been displayed, and a weird button in the middle of the screen, that when clicked, brings me to a new screen with the record I just added, and then you still have to click the MODIFY button!. Why can’t it go directly to the new record in EDIT MODE? It is really convoluted.

image

There is no such thing as a ‘Show New Form’ action. I think you are getting confused between ‘Show New Screen’ and ‘Show Form Screen’. Show New Screen shows a new details layout screen based on tables, relations, or to create a secondary screen attached to the same row as the current screen. Show New Form is like the Add (+) option on a list layout. The difference between Add Screens and Form screens is that the form can access and pull data from the parent row of the screen that contains the form button. Forms can also write to any other table regardless of which tab you are on.
image

I think the point we are trying to get at is that you don’t need any of those complicated actions to create a new row and then go into it in edit mode. Just add a form button to your screen to add a new City row. All info from the user table and the table that contains the form button can be passed through the form without requiring the user to enter anything. All they should need to enter is their City name and submit. Everything else will populate automatically. All the user will have to do is click on the form button, enter there city, and submit.

This is just to establish the title for the form screen. Once you are in the form, then you can customize all of the components within the form. You don’t customize a form screen through an action. You have to be on the screen to modify it.

When you created the last record. Take the whole row as compared to just one value.

Yes, I meant new screen, but I showed you what it shows me.
The user has to click on the orange dot with the right arrow, and then has to select the record, and then has to select modify. Just wanting to add a new record and go directly into modify mode with it (yes, you said it is simple, but I’ve been told in this thread I need to add columns and relations, etc.).

image

“I think the point we are trying to get at is that you don’t need any of those complicated actions to create a new row and then go into it in edit mode. Just add a form button to your screen”

And that is what I have…

image

image

Since the only thing that can be on this form is a drop down and a button – I cannot see how to add an editable field, I potentially need to take them (after they select a city and click the button) to a MODIFY screen where they could enter other information or modify the record that has been added for them. I cannot get there with the available actions, that I can see.

I found this thread yesterday, but it is gibberish to me. There are no screen shots or any explanations at all, but it seems like this guy got it to work…

I think you are making it much too complicated. You should go directly into a form instead. That form button can be anywhere in your app. It looks like you are doing it in a tab. That’s fine if that’s what you want, but scrap the whole city choice and the Add new Record button with all of those actions. Just create a new button with the Show New Form action. Then click on the form button to edit the form. There you can have your dropdown choice to select a city and submit. That’s it. It will generate the new row and it will be populated with everything that you need. You can pull in that additional info from the user table, the special value table, or any column values from the table that drives that tab. You just add them like components, but they are hidden from view and automatically passed through when submitted. All the user should see in the form is the City Choice component.

You are not using a Form button. You have a tab with a button that has a set of actions that ultimately open a different tab or goes to a new screen. You need to go to a Form, not to a Screen. It seems like you are trying to emulate a form by creating a row first and then editing it. I think the only thing you need to do is open a form and submit, which is essentially editing a row before it’s added to the table.

1 Like

Thanks. But I’m confused. Yes, I want to make it easy.

I am on a free version of Glide. I only see tabs and menu items. Where do I add a form that goes directly into add mode?

Help me understand. What you are describing is exactly what I want. Just don’t know how to get there.

image

Just add another button component to your ‘Add New’ tab screen. Exactly the same way you added the ‘Add New Record’ button. You can add a Floating Button, a Regular Button, or a Form Button. Doesn’t matter. Then just set the action on that button to ‘Show Form Screen’. Preferably create a custom action that contains the ‘Show Form Screen’ action. That way you can add other actions later if you need to without rebuilding the form.

Even further, you could eliminate the ‘Add New’ tab altogether and place the button in your ‘Records’ tab.

Well, right now the records tab comes up as a list, and you cannot even add a floating button to that screen. That would be nice. But right now they’d only see the floating button if they go into a record to modify it.

I added a floating button, with the action “Show Form Screen”, but it’s not obvious to me exactly how to set the defaults of the fields. It does work, and I can add components to the screen, but how do I set the defaults of those values so that when they say “submit”, the record gets written the way I want? It seems to just be putting values in there of the last record that was in memory.

Sorry I seem so confused, but I’ve gotten so many different answers to this, and it does not seem to be working the way even you expect that it should.

image

You can change the layout to a Details layout and add an inline list component that displays the same list.

What all do you want submitted? There are User Profile components that pull values from the signed in user’s profile record, there’s Column Value components which pull values from whichever row your detail screen (that contains the button) is attached to, and there’s Special Value components, such as user email, date/time, and unique id. Those components don’t show on the screen but you can point them to the destination columns you want.

If you want to add default values to the visible components, then click on the component and edit the default value on the right hand side of the builder. You can manually type in a default, pull a value from the user profile record, or you can pull defaults from the parent row of the screen that contains the form button.

3 Likes

OK, that is where the confusion came in for me. I was adding text-only components because I don’t want the value changed. With those, you cannot set the default value.

I can add the components as editable text and that will allow me to set the default (and then make those components not visible), but on the screenshot below, you can see I set the default value to one thing on the email (david@gmail.com – the editable component that will be made not visible), but the text-only component that is not visible is displaying the value from the last record read (jennifer@gmail.com)

So I can either set the default and allow them to change it, or just not show them any of the other fields unless they are able to change them. Otherwise, it will be confusing to the user…

The record correctly saved with the default value, BTW.

image