Is there a way for the initial Value of a column to be different depending on what view of the app you are in?
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!
User | Count |
---|---|
15 | |
15 | |
8 | |
7 | |
4 |