Is there a way for the initial Value of a col...

Is there a way for the initial Value of a column to be different depending on what view of the app you are in?

0 15 1,377
15 REPLIES 15

Wellโ€ฆ the problem is you donโ€™t know the view where you are because you donโ€™t have any expression to read that. If you think this from another perspective, you could achieve that. I assume you are asking this for the slice. If you use the same condition rule for IFS expression than you have for that slice, you have that functionality. Another one workaround could be the action button. You can show a different action button depending on the same slice condition rule.

can you explain this a little more to me please and how the function works?

Would you please open your request little more. Are these views from different slices?

@Aleksi, were you able to get an answer for this?

I have a slice called RMS, another called SHHS, and another called R6G. I would like for the initial value for the ID Column to be โ€œRMSโ€ for the RMS slice, โ€œSHHSโ€ for the SHHS Slice and โ€œR6Gโ€ for te R6G Slice. how can I write a formula for this in the initial values?

Hi,

Have you tried to create an action where type of action is โ€œApp:go to another view within this appโ€. and app link target is as below:
LINKTOFORM("(The name of RMS slice"_Form, โ€œID Columnโ€, Concatenate(โ€œRMS-โ€,UNIQUEID()))

If you have one form view for one slice, you could read it with the expression CONTEXT(โ€œViewโ€) and then you could use something like
SWITCH(CONTEXT(โ€œViewโ€),
โ€œRMS_Sliceโ€,โ€œRMSโ€,
โ€œSHHS_Sliceโ€,โ€œSHHSโ€,
โ€œR6Gโ€)

Thanks Aleski would i put this in the initial value section?

I put it in the initial value and it only returned R6G in all 3 forms. There is a separate form for each slice. Any ideas?

It depends do you want to set it as a fixed value or should it change when the record is opened and saved.

I want it to be that everytime a new record is added in the RMS slice that the [ID] column is set to RMS. The idea is to save time while filling out the form

Then you could probably use it as an initial value.

Solved it! I created an IFS condition based on your input @Aleksi and put it in the initial value of the column I wanted it to apply to:

IFS(CONTEXT(โ€œViewโ€) = โ€œRMS_FORMโ€, โ€œRMSโ€, CONTEXT(โ€œViewโ€)= โ€œR6G_FORMโ€, โ€œR6Gโ€, CONTEXT(โ€œViewโ€)=โ€œSHHS_FORMโ€, โ€œSHHSโ€, CONTEXT(โ€œViewโ€)=โ€œPyramid Formโ€, โ€œPyramidโ€)

It worked perfectly.

Your expression can be simplified:

SWITCH(
  CONTEXT(โ€œViewโ€),
  โ€œRMS_FORMโ€, โ€œRMSโ€,
  โ€œR6G_FORMโ€, โ€œR6Gโ€,
  โ€œSHHS_FORMโ€, โ€œSHHSโ€,
  โ€œPyramid Formโ€, โ€œPyramidโ€,
  ""
)

So helpful. I was just stuck on this problem. It totally worked. Thanks!

Excellent!

Top Labels in this Space