# Runtime property not set to Value on create when loaded into app data

**URL:** <https://community.appfarm.io/t/runtime-property-not-set-to-value-on-create-when-loaded-into-app-data/627>\
**Category:** Feature requests\
**Tags:** data-source\
**Created:** [August 16, 2023, 5:54pm UTC](https://community.appfarm.io/t/runtime-property-not-set-to-value-on-create-when-loaded-into-app-data/627 "2023-08-16T17:54:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kaspar](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/kaspar/32/3073_2.png) [@Kaspar](https://community.appfarm.io/u/Kaspar)\
**Post date:** [August 16, 2023, 5:54pm UTC](https://community.appfarm.io/t/runtime-property-not-set-to-value-on-create-when-loaded-into-app-data/627/1 "2023-08-16T17:54:50Z")

</div>

Hi,  
I’m trying to use a boolean runtime property “Edit mode” on my Database connected source to control if the object should be in edit mode (input fields enabled) or not. If “Edit mode” is true, I want to display a “Save” and “Cancel” button. If “Edit mode” is false, I want to display an “Edit” button.  
As I want to control the edit possibilities for each object, I figured a runtime property would be the best. And as I don’t want the object to be in edit mode from the start, I’m setting “Value on create” to False.

However, when the app loads and the data source populates the runtime property isn’t set to any value. In my debugger, I see that the fields are left blank (no value). I’m unsure if this is a bug as the objects aren’t created, just retrieved from the database. And if that’s the case, I would love to request a feature that handles this. Some sort of “Initiate to” field.

While waiting for this to be fixed or featured, I can populate the fields, e.g., by updating the objects using On View Load. But this seems like an unnecessary extra step…

---

<div class="post-metadata">

**Author:** ![kristian](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/kristian/32/58_2.png) [@kristian](https://community.appfarm.io/u/kristian)\
**Post date:** [August 16, 2023, 7:09pm UTC](https://community.appfarm.io/t/runtime-property-not-set-to-value-on-create-when-loaded-into-app-data/627/2 "2023-08-16T19:09:35Z")

</div>

Hi!

The Default value on a Runtime property on a Data Source is only set when an object is Created into that Data Source, not when data is read / filtered into it.

Which one is the case here?

PS: You may use the built-in Data Source property [Object State](https://docs.appfarm.io/reference/apps/data/data-sources#data-source-object-properties) in your condition to determine whether you are in “Edit mode” or “Create mode”. The object will have Object State `New` when the object has never been saved, `Updated` if it is an existing object with unsaved changes, or `Synchronized` if it is an existing objects, but with no changes.

---

<div class="post-metadata">

**Author:** ![Kaspar](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/kaspar/32/3073_2.png) [@Kaspar](https://community.appfarm.io/u/Kaspar)\
**Post date:** [August 16, 2023, 7:26pm UTC](https://community.appfarm.io/t/runtime-property-not-set-to-value-on-create-when-loaded-into-app-data/627/3 "2023-08-16T19:26:09Z")

</div>

Hi @kristian,  
The objects aren’t created, just read from the database so, by what you’re writing, this is expected behavior.

Your suggestion of using Object State is a neat possibility, but in this case, I’m updating/editing objects without using a runtime data source. The updates are done directly to a database-connected data source.

I would love to request the ability to set runtime properties to an initial value when reading/filtering values from database-connected data sources.

---

<div class="post-metadata">

**Author:** ![kristian](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/kristian/32/58_2.png) [@kristian](https://community.appfarm.io/u/kristian)\
**Post date:** [August 16, 2023, 7:43pm UTC](https://community.appfarm.io/t/runtime-property-not-set-to-value-on-create-when-loaded-into-app-data/627/4 "2023-08-16T19:43:00Z")

</div>

Hi,

We’ll discuss that one internally - if it’s conceptually ok and what it takes.

Another tip: you may use “Not Equals `true`” instead of “Equals `false`” in your conditions. That way, a property doesn’t need to be explicitely set to false. You just consider “everything else but `true`” versus `true` instead of `false` versus `true`.

---

<div class="post-metadata">

**Author:** ![Kaspar](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/kaspar/32/3073_2.png) [@Kaspar](https://community.appfarm.io/u/Kaspar)\
**Post date:** [August 16, 2023, 7:55pm UTC](https://community.appfarm.io/t/runtime-property-not-set-to-value-on-create-when-loaded-into-app-data/627/5 "2023-08-16T19:55:42Z")

</div>

Sounds good 😃 And thanx for the great tip – I’ll implement it right away
