diff --git a/src/Entity.jl b/src/Entity.jl
index 90caff7808e8bcd72a69f111467897aac97cf639..c41711b48719bf4df408a1c2b1be445391d85ea3 100644
--- a/src/Entity.jl
+++ b/src/Entity.jl
@@ -251,6 +251,8 @@ end
         name::AbstractString = "",
         datatype::AbstractString = "",
         unit::AbstractString = "",
+        is_reference::Bool = false,
+        is_list::Bool = false,
     )
 
 Return a new entity object with role Record. If `name`, `datatype`, or
@@ -284,12 +286,17 @@ end
     function create_property(;
         name::AbstractString = "",
         id::AbstractString = "",
-        value::AbstractString = "",
+        value::Union{AbstractString, Number, Bool} = "",
+        datatype::AbstractString = "",
+        is_reference::Bool = false,
+        is_list::Bool = false,
      )
 
 Create a property object that can be appended to another `_Entity`. If
 `name`, `id`, or `value` are given, the property's name, id, or value
-are set accordingly.
+are set accordingly. The datatype and whether it is a list or a
+reference can be specified with `datatype`, `is_reference`, and
+`is_list`, respectively.
 
 !!! info
 
@@ -299,7 +306,7 @@ are set accordingly.
 function create_property(;
     name::AbstractString = "",
     id::AbstractString = "",
-    value::AbstractString = "",
+    value::Union{AbstractString,Number,Bool} = "",
     datatype::AbstractString = "",
     is_reference::Bool = false,
     is_list::Bool = false,
@@ -1518,13 +1525,23 @@ function set_unit(property::Ref{_Property}, unit::AbstractString)
 end
 
 # TODO(henrik, daniel) overload to choose the correct set
-# function. Should throw an error for entities with role != PROPERTY.
+# function.
 """
     function set_value(entity::Ref{_Entity}, value::AbstractString)
 
-Set the value of the given `entity` object.
+Set the value of the given `entity` object. Throw an error if it
+doesn't have the correct role.
 """
 function set_value(entity::Ref{_Entity}, value::AbstractString)
+
+    if get_role(entity) != "PROPERTY"
+        throw(
+            CaosDB.Exceptions.ClientException(
+                "Only entites with role PROPERTY may be assigned a value.",
+            ),
+        )
+    end
+
     err_code = ccall(
         (:caosdb_entity_entity_set_value, CaosDB.library_name),
         Cint,