Pass the current record ID to a form

Hi,

Sorry for the newby question!!!

I have a form with a list of companies and I have sub records in another table, which I show as an inline list using a relationship.

I am trying to be able to simply add a sub record to the list with values.

So I tried a button which can add the record, but you then need to click on it in the list and then edit it, so three functions, which is a bit clunky, but it works

I am now trying the “Open Form” Button option, which appears to do what I want. Bang open a form and create a new record in the sublist. This all works, but I am struggling to find how to get it to inherit the ID of the current company record that it is in, in order that when it is saved it then slots into the relationship. At present it just adds a record, with a null company ID.
is there some form of global variable or way to have a form like this inherit or prepopulate a value from the current master record when you open it? I can only see how to set a Date or Current User Email??

Again sorry for the stupid newbie question.

David

Have you tried a compound action using Set Column and choosing to use the ID for the sub record ID column?

That sounds like an idea.
I did try the compound action, but the set column seamed to be in the table I was in on my current form, rather than the sub form.

I’ll have another play.

It’s hard coming from a coding background to no code.

I would do a new record in the sub table through a relationship in sql, then show the form with that record selected.

Hi Joe,
SO I tried that. I can set the record in the sub record fine and it creates a record. I used the Add Row as the first part of a compound action.

What I cant work out how to do is then show that record in a form so the custom values can be added immediately thereafter.

i.e add one to many sub record and immediately go into the edit mode. If i do a compound action and then a show form it just creates a second blank record with the form, but without the prepopulated data.

I cant find a simple tutorial on what I would have thought would be a bread and butter function of adding an order to a company in a demo CRM. It seams wholly unnatural to add a record. click on it in the inline list and then hit edit at the top of it, in order to add and edit a new sub record.

Any pointers to a template solution that does this or a video would be most welcome.

Sounds like you have a Company sheet with an ID column, then what you would want is in your form, use the ID column in your “screen values” list and pass it to the right column in your sublist sheet.

thanks,
Ill research that and have a go!!

All new, but its just pivoting principles from other worlds into this!!

1 Like

I am sorry for being a pain, but learning quickly.

So in my company form, I have an inline list of “investments” in this case.
I do, of course, have a companies to investments, multiple relation defined

Could you walk me through the steps.

I added a show form button, and I can tell that form to be in the investments table.
What I am still struggling with is this “Screen Value” option.
Where can I set the Fk_IdCompanies in the investment table to be the IdCompanies of the record I am on when I hit the show form button.

I tried a new action to try and do this in a sequence, but cant seam to find the place to populate this value, or hold it to then populate it when the form is shown.

Thanks in Advance. Despite all of this, I am creating an APP that would have taken me 3 weeks in Angular, in about 2 days, but once I have this knowledge probably about 2 hours in future!!!

I am sure there is a simple

I just cant see either in a single action

Very happy to help.

Firstly, I assume you’re having the form inside a company’s detail view. And each of your companies’ rows has a rowID.

You click the plus button here to open the insert component window.

image

Then you’ll find your rowID column to pass to what should be called “Company ID” in the Investments sheet.

2 Likes

@ThinhDinh,

Thats was super helpful.
Firstly, I hadn’t clocked that Glide has its own RowID field that auto filled, and was using my own CompanyID value and populating a UUID!

So having changed those, I then did a bit of playing and the answer is:

  1. Add the Show Form Button.
  2. Click it to open the form and set the destination to you sub table.
  3. Then, it appears that the Screen Fields are available then, and yes they relate to the original details form of the company. (For a minute I thought the RowID was for the sub form, but it shows it isnt.
  4. Then setting my Fk_IdCompany to the RowID does the trick.

Loving this more an more.

Thanks for all your help.

2 Likes

Feel free to ask us if you have any more questions!

1 Like