Chris Sterling
Chris Sterling

Reputation: 57

Adding Demographics in Valence

I have a quick question in regards to adding demographic data in D2L/Valence.

It looks like when you want to add Demographic data to a user, you need to send a UserId and a list of EntryValues.

The EntryValues are comprised of DemographicsEntry which is a Name (string) and Values (array)

Does that name have to match an existing DemographicsField field? If not, can I pass a FieldId when adding a DemographicsEntry to a user to attach that data to a specific field?

Upvotes: 0

Views: 78

Answers (1)

Viktor Haag
Viktor Haag

Reputation: 3418

One way to think about it is that all users will have values for a defined set of demographics fields, and you can define those fields (that is, you can add fields, if you want). Whenever you want to update a user's demographics data, you must provide values for all the demographics fields; so, first fetch a user's current set of data, alter the values of the fields you want to alter, and then PUT back the updated block.

If your user has no demographics data, then you'll get a 404 for the GET to fetch their field values. In this case, you'll need to fetch back all the legal fields, and then use those to compose up a block of demographics data that you do want to PUT to the user.

Upvotes: 0

Related Questions