Can I make the first argument of LINKTOFORM a variable?

In my app sheet, I have different tables to manage different inventories in different building.
I would like to use the LINKTOFORM function like this to add a button to move inventories between buildings.

But the problem is that LINKTOFORM has a fixed view-name argument. For example, I have three tables, Building A, Building B, and Building C. I would need six actions:

  1. โ€œBuilding A to Building Bโ€
  2. โ€œBuilding A to Building Cโ€
  3. โ€œBuilding B to Building Aโ€
  4. โ€œBuilding B to Building Cโ€
  5. โ€œBuilding C to Building Aโ€
  6. โ€œBuilding C to Building Bโ€.

It does not scale up nice if we have more and more buildings.
Is it possible to have a action called โ€œto Building Bโ€. When performing that action on Building A, it will do โ€œA to Bโ€. When performing the same action on Building C, it will do โ€œC to Bโ€?

0 5 83
5 REPLIES 5

That is correct, it cannot be variable. However you can still build a variable expression. Instead of this:

LINKTOFORM( [variable-view] ... )

You can do:

SWITCH(
  [variable-view] ,
  "view a" , LINKTOFORM( "view a" ... ) ,
  "view b" , LINKTOFORM( "view b" ... ) ,
  ...
)

You would still need a create separate Actions for each Table though.

I recommend merging your inventory Tables into one, and including a [building] column.

Can I create different view out of the [building] column? I would like to use the bottom bar feature to access different buildings.

I don't know what you mean by that.

Thanks for the quick reply!
In our app, we want to use the bottom bar (indicated by a red circle in the image).

But it seems that this bar only appears when I put different "building"s into different sheets.

How to keep this bottom bar  when I move everything to the [building] column?

Screenshot 2022-02-15 at 11.20.03.png

Ohhh, I think I understand what you're asking. Check out Slices

https://help.appsheet.com/en/articles/895302-slices-the-essentials

You can create a Slice for a specific building, with condition [building]="xxx", then set your Views to the Slices instead of the base Table.

Top Labels in this Space