Local variable calling rule not updating when referenced variable updated.

I have a problem where I have a local variable in an interface that calls an expression rule. The expression rule has one input and this input is entered using another local variable. The problem is that when the referenced local variable is updated, the other variable calling the expression rule does not update. I have provided a proof of concept below that replicates my problem.

The first variable "selectedCentre" is just an integer that can be updated in the integer field, this variable is used in the rule called by the second variable "projectCounts". I've tried a few variations of with, load, and localvariables but just cannot get the rule to be called again and update projectCounts.

Any tips on what to look for would be appreciated. Thanks.

a!localVariables(
local!selectedCentre: 1,
local!projectCounts: a!refreshVariable(
value: rule!FLO_GetProjectCountsForAllCentres(
local!selectedCentre
),
refreshOnReferencedVarChange: true
),
a!columnsLayout(
columns: {
a!columnLayout(
contents: a!paragraphField(
label: "project counts",
value: local!projectCounts
)
),
a!columnLayout(
contents: {
a!integerField(
label: "Centre",
value: local!selectedCentre,
saveInto: local!selectedCentre,
refreshAfter: "KEYPRESS"
)
}
)
}
)
)

  Discussion posts and replies are publicly visible

Parents
  • Hello, I've had this issue also, and the problem was simple, the rule that I was calling for the refreshed variable, had a single local!variable and then returned that same variable (the local variable was not needed as nothing was being done with it).

    a!localVariables(
      local!test: a!queryEntity(),
      local!test
    )

    In this case it was unnecessary, and after removing it and just returning the value, in the calling View the refresh variable was being correctly updated.

    This can be another motive.

    Kind regards,

Reply
  • Hello, I've had this issue also, and the problem was simple, the rule that I was calling for the refreshed variable, had a single local!variable and then returned that same variable (the local variable was not needed as nothing was being done with it).

    a!localVariables(
      local!test: a!queryEntity(),
      local!test
    )

    In this case it was unnecessary, and after removing it and just returning the value, in the calling View the refresh variable was being correctly updated.

    This can be another motive.

    Kind regards,

Children
No Data