         
         // store it in local cache so it will get updated to Bridge next time
         SBAClientDataProfileItem.addToCurrentValues(whatAndWhen.cachedDictionaryRepresentation(), forProfileKey: profileKey)
+    }
+    
+    open func setValue(_ newValue: Any?, asOf when: Date, to scheduledActivity: SBBScheduledActivity) {
+        guard let jsonValue = commonItemTypeToJson(val: newValue) else { return }
+        
+        let whatAndWhen = SBAWhatAndWhen(jsonValue, asOf: when as NSDate)
+        
+        // store it to the specified scheduled activity's clientData
+        setTo(scheduledActivity, jsonWhatAndWhen: whatAndWhen.dictionaryRepresentation())
     }
     
     open func valuesAndDates() -> [SBAWhatAndWhen] {



/**
 The activity to which an SBAClientDataProfileItem is attached must be scheduled as persistent so there is always
 an appropriate SBBScheduledActivity object on which to save it. Its clientData must also be a JSON dictionary, and
 the values set here will be stored at the top level by sourceKey as a list of dictionaries containing "date" and
 "value" entries. Ideally there will end up being one item in the list for each finished instance of the ScheduledActivity
 on Bridge, but if the client is unable to mark the item finished and receive the new scheduled instance before a
 new value is set, there could be more than one (hence the "date" timestamps).
 */
open class SBAClientDataProfileItem: SBAProfileItemBase {
    // ClientData profile items are attached to and read from the most date-appropriate instance

        super.init()
    }
    
    public init(_ value: SBBJSONValue, asOf date: NSDate, isNew:Bool = false) {
        self.value = value
        self.date = date
        self.isNew = isNew
