Creating a temporary variable in Memory of ODK Collect

Is there a way of creating temporary variable in memory in ODK Collect, without creating it within the data output? I have never come across this feature ever since i started creating forms in ODK.

1 Like

Hi Vincent!

You can create a temporary variable (a calculate) in your form and those calculates are hidden to the user who is entering data (e.g., in ODK Collect). Those calculates are stored in the instance/submission and most (probably all) the servers in the ecosystem will export that as part of the output by default.

You can, of course, filter this output as you see fit. For example, you can prepend vincents_temp_ to the name of the calculates you wish to ignore and then in your data processing pipeline, throw those columns away. If you are using ODK Aggregate it has some filtering functionality that you can try.

1 Like

Ok @yanokwa thanks, But i know the calculate method but i thought there is a way of creating temporary variables that does not require filtering. Because, with the current calculate method, assuming you want to create multiple temporary variables that means a lot of work in filtering the variables.

Hi @Vincent_Mkandawire,

When you say a temporary variable you mean a variable which is a hidden field to the enumerator? If so, you can avoid calculate by simply making it hidden. In doing so with multiple variables, make all those variables relevant to an impossible input in a previous question.

@awaafo_donald what i mean is that the temporary variable should not appear in the data output without need to using filter or calculate or what i mean is creating a variable that resides in the Random Access Memory (RAM) of the android device. Can you explain how you can hid it? Am assuming you are not talking about skip logic using relevant, which normally keeps the variables in the database.

1 Like