Forum Discussion
Thank you VarunGrazitti and bhupen ! I've made progress, but would love your advice, as I'm a bit stuck.
Lithium set up the fields, which is awesome. I'm now trying to set and retrieve values from the two custom profile fields:
profile.ideas_terms_accepted – Which is a checkbox
profile.ideas_terms_accepted_date - Which is date/time, and the value must be a signed decimal integer. It is interpreted as milliseconds since Jan 1, 1970. The value by default is displayed to include time.
So far, this is my code to set and retrieve the value for profile.ideas_terms_accepted field:
<#assign response = restadmin("/users/id/${user.id}/profiles/name/ideas_terms_accepted/set?value=true")/>
<#assign terms_accepted = rest("/users/id/${user.id}/profiles/name/profile.ideas_terms_accepted").value>
alert('${user.id}');
alert('${terms_accepted}');
It's not working. The ${user.id} is returning properly, but ${terms_accepted} is not returning a value. I tried both "true" and "checked" for the field value.
For the profile.ideas_terms_accepted_date field, I'm not sure how to generate a "signed decimal integer". I searched the community for that phrase and nothing came up.
Tips on settings and getting these values would be awesome!
- Alan
hi iftomkins
not too sure about the exact context
but one thing noticed was your first REST call URL:
.../profiles/name/ideas_terms_accepted/...
and your 2nd REST call to retrieve URL was this:
.../profiles/name/profile.ideas_terms_accepted/...
should it be just .../profiles/ideas_terms_accepted/... (without the "profile.") in the 2nd REST call?
Related Content
- 10 months ago
- 10 months ago
- 10 months ago