Question regarding v1/attributes resolverefs

Started by thrinn, July 12, 2017, 09:14:41 PM

Previous topic - Next topic

thrinn

Hi Mario,
how is the resolverefs parameter of v1/attributes GET supposed to work?
For example, I have an per-file attribute set Calculation with an attribute of type Reference pointing to the customer id in a global set Customer. If I retrieve the data, I get all attributes of set Calculation, including the reference attribute, but none of the Customer fields. I guessed with resolverefs = true they would somehow be included in the result. I just want to understand if this works as designed. I can easily use a second call to retrieve the attributes of the referenced set if needed.

The Attributes sample app shows exactly the same result, it does not matter if the "Resolve references to other Sets" is activated or not.

{
  "result": [
    {
      "id": 31,
      "data": [
        {
          "instanceId": 1,
          "Text": "Pictures",
          "Quantity": "2",
          "Price": "5.000000",
          "Tax": "8.000000",
          "refCustomerID": "1"
        }
      ]
    }
  ],
  "debug": {
    "runtime": "0ms"
  }
}


Tested with 2017.7.4 and 2017.7.6.
Thorsten
Win 10 / 64, IMatch 2018, IMA

Mario

If resolverefs is true, the reference to the other set is resolved (IMWS returns the data from the referenced Attribute, not the id stored in the source Attribute). It will not somehow include the full attribute record of the reference, if this is what you expect. This is up to you.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

thrinn

Thorsten
Win 10 / 64, IMatch 2018, IMA