add an action based on slice info

I'd like to have an add form that only shows in a slice that will carry some slice info with it. example, if click on a add form action within a slice with a filtered [type], when i click on that action within the slice, it should instantly pick that type in the form. can this be done? 

0 3 66
3 REPLIES 3

Columns can be pre-filled like that in some circumstances. For example if you use a drill-down grouping, or I believe a simple condition in a LINKTOFILTEREDVIEW, and click the add from there, it should pre-fill the grouped/filtered-by column. I don't believe the same thing works with Slices, but it could be worth a test.

 

Steve
Platinum 4
Platinum 4

@infinitiapps wrote:

when i click on that action within the slice, it should instantly pick that type in the form. can this be done? 


The easiest way is to use CONTEXT() to get the form view's name and set your initial value according to it.

SWITCH(
  CONTEXT("View"),
  "slice-1_Form", "slice-1-value",
  "slice-2_Form", "slice-2-value",
  ...,
  "default-value"
)

Ended up creating a new action that sets a new data value in a enum type column.  [column] = "Personal", and selected that behavior when the form is saved within the sliced form view.  Could context() work the same @Steve or Linktofilteredview @Marc_Dillon ?

Top Labels in this Space