Hello,
New to Appsheet.
We are building a project management app with three main tables:
Project
ProjectStage
Task
Objective:
We want only the Project Stages, for the specific Project, to appear in the Ref drop down when new Tasks are created
We want to set the Initial Value of the Task[ProjectStage] column to a specific default value based on a formula
The default Project Stage value will be specific to the Project
The default name of the Task[ProjectStage] will be "Stage To Be Decidedโ
Each Project will have a Project Stage named โStage To Be Decidedโ
The various Project Stages that are named โStage To Be Decidedโ all have unique Primary Keys (i.e. different ProjectStage.ID values)
Below is an example:
Project | | ProjectStage | | ProjectStage[ID]
App Build | | Stage To Be Decided | | 1
Learn French | | Stage To Be Decided | | 7
Coaching | | Stage To Be Decided | | 21
Table Structure Notes:
The relationship between the tables is as follows:
Project has a de-reference relationship with ProjectStage
ProjectStage has a de-reference relationship with Task
MYSQL foreign key relationships define the column names (with the exception of the virtual columns which are highlighted in italics, with the app formula appearing below)
Important columns
Project Table
-Related ProjectStages
REF_ROWS(โProjectStageโ, โProject_idProjectโ)
ProjectStages Table
Task Table
Task.ID
ProjectStage_idProjectStage
-ProjectName
[ProjectStage_idProjectStage].[ProjectName]
-ProjectStageName
[ProjectStage_idProjectStage].[Name]
Current Valid If Statement for the Project Stage column in the Task table
IFS(
ISNOTBLANK([ProjectID]),
ORDERBY(
FILTER(
โProjectStageโ,
AND(
ISNOTBLANK([Project_idProject]),
([ProjectID] = [_THISROW].[ProjectID])
)
),
[ProjectStage_idProjectStage]
)
)
This formula works as expected to provide the Project Stage values that are specific to the current Project
Problem / Question
We are trying to set the initial value of Task[ProjectStage] programatically, based on a formula. When the initial value is hard coded, to a specific Project Stage ID, the default initial value works correctly and only the Project Stages for the specific project appear in the drop down. But we need to use a formula set the initial value for Project Stage.
Our Attempt
ANY(SELECT(ProjectStage[ID],AND(IN([_THISROW].[ProjectStage_idProjectStage],Project[Related ProjectStages]),[ProjectStageName]=โStage to Be Decidedโ)))
The initial value formula above leads to a circular reference
Thanks in advance,
Alex
User | Count |
---|---|
28 | |
14 | |
3 | |
3 | |
3 |