Hello,
I need to complete a userlookup column from an isheet via API call. Is it possible? Is this type of column supported by API calls?
Hello,
I need to complete a userlookup column from an isheet via API call. Is it possible? Is this type of column supported by API calls?
Maria Sarra, if you mean that you need to set the value of a user lookup field for an iSheet item (record), then yes but there are some hoops to jump depending on what information you already have. Firstly, you need to know what types of values this column has been configured to accept, i.e. the values in the "Select Lookup" drop-down:
And also whether the "Allow multiple users and/or groups" has been checked, or is just single selection.
If you do not already have the User/Group ID's you want to set, you will need to search for these using various API calls, e.g.
Once you have that data, then you can all either the Add or Update iSheet endpoints, where the payload will depend on what configurations are set for that lookup column. For example, below is the payload for a user lookup column that has been set to (6) All Site Users and Groups, and where multiple values are valid. The example below supplies: 1 user ID, and 1 site group ID to be set against that user lookup column:
{
"data": {
"item": [{
"itemsequence": 1,
"alerteroption": 1, // RESPECT_USER_PREFERENCE alert options
"column": [{
"attributecolumnid": 9999, // user lookup column ID
"rawdata": {
"lookups": {
"lookup": [{
"id": 999, // as userlookuptype = 1, this is the userID
"userlookuptype": 1
}, {
"id": 999, // as userlookuptype = 2, this is the site GroupID
"userlookuptype": 2
}
]
}
}
}
]
}
Hope this helps
Andrew
]]>Maria Sarra, if you mean that you need to set the value of a user lookup field for an iSheet item (record), then yes but there are some hoops to jump depending on what information you already have. Firstly, you need to know what types of values this column has been configured to accept, i.e. the values in the "Select Lookup" drop-down:
And also whether the "Allow multiple users and/or groups" has been checked, or is just single selection.
If you do not already have the User/Group ID's you want to set, you will need to search for these using various API calls, e.g.
Once you have that data, then you can all either the Add or Update iSheet endpoints, where the payload will depend on what configurations are set for that lookup column. For example, below is the payload for a user lookup column that has been set to (6) All Site Users and Groups, and where multiple values are valid. The example below supplies: 1 user ID, and 1 site group ID to be set against that user lookup column:
{
"data": {
"item": [{
"itemsequence": 1,
"alerteroption": 1, // RESPECT_USER_PREFERENCE alert options
"column": [{
"attributecolumnid": 9999, // user lookup column ID
"rawdata": {
"lookups": {
"lookup": [{
"id": 999, // as userlookuptype = 1, this is the userID
"userlookuptype": 1
}, {
"id": 999, // as userlookuptype = 2, this is the site GroupID
"userlookuptype": 2
}
]
}
}
}
]
}
Hope this helps
Andrew
]]>