link to form

I have an action button that will link to a form "locations."  I can transfer some date over to the form but I want to create a new location ID.  Location ID is a key so I can't use any formulas.  It defaults to 0.  I want it to default to the latest location ID.  It's basically the row number but I want it to populate a new and latest location ID.  I'm missing something that I can't figure out.

Solved Solved
0 6 259
1 ACCEPTED SOLUTION

It is unclear what you're asking, or what behavior you are describing.

You're using LINKTOFORM() ?

How do you want to create a new location ID?

What defaults to 0?

For the latest something, you need to use MAXROW(), possibly combined with a LOOKUP().

https://help.appsheet.com/en/articles/2357310-maxrow

https://help.appsheet.com/en/articles/2357309-lookup

 

View solution in original post

6 REPLIES 6

You can't!

But you can have another column that calculates and shows the value of the last key.

And you can rather actually should use formulas for key columns. 

What's the formula for the last key?  

Are you sure you can't?  When I open a form for locations, shouldn't it automatically create a new unique location ID?

Yes you can't have a new form with key column initialized to the value of an existing key. If you use an existing key then you'll be editing the corresponding row. And you cannot change the key of an existing row. 

Regarding your question, please have a look at this:

FAQ: FILTER(), LOOKUP(), MAXROW(), MINROW(), REF_R... - Google Cloud Community  

It is unclear what you're asking, or what behavior you are describing.

You're using LINKTOFORM() ?

How do you want to create a new location ID?

What defaults to 0?

For the latest something, you need to use MAXROW(), possibly combined with a LOOKUP().

https://help.appsheet.com/en/articles/2357310-maxrow

https://help.appsheet.com/en/articles/2357309-lookup

 

I have two tables:  employers and locations.  While I am in the employers view, I have an action button to create a new location for this employer.  I use linktoform to open a new location form.  I want the location ID to be new (new row).  However, I want to import the employer's info into this new form.  It'll just have a new address.  The new location will have the employer's info or at least the employer ID so I can ref all the locations for the employer.  Am I approaching this the wrong way.  I'm sure there's a much simpler way to add a location and link to an employer.

Max row did the trick.  Thanks!

Top Labels in this Space