3 Replies Latest reply on Jul 17, 2018 3:52 AM by jyi

    SelectedField Items.Value.Value not returning value

    Roger Palmen

      I get the direct descendants of an attribute (aka child attributes) yet the postfix "/attributes?SelectedFields=Items.Name;Items.Description;Items.Path;Items.WebID;Items.Value.Timestamp;Items.Value.Value" does not return the Item values, like it should (per example here: Request Rejected ). I do get the other fields (Name, Description,Path, WebID).

      I do this on a call: https://<<AFserver>>/piwebapi/attributes/<<attributeWebID>>

       

      Any restrictions at play here? 

        • Re: SelectedField Items.Value.Value not returning value
          jyi

          Hi Roger,

           

          If you are getting information from below resource, then it is expected the behavior of selectedFields to not return Items. Below URL does not contain resource for values/Items.

          https://<<AFserver>>/piwebapi/attributes/<<attributeWebID>>

           

          The Items.Value.Timestamp and Items.Value.Timestamp are available with this URL though.

          https://<<AFserver>>/piwebapi/attributes/<<attributeWebID>>/recorded

           

          The selectedFields parameter can only return the available resource. URL #1 contains Links to your recorded/interpolated values but not the values itself directly. You either have to make a separate call using the Value Link from URL#1 or Batch them.

           

          Best,

          Jin

          1 of 1 people found this helpful
            • Re: SelectedField Items.Value.Value not returning value
              Roger Palmen

              Hi Jimmy,

              My apologies for the slow response, i had a few days off...

              I already habd a batch call in my code, but when refactoring i wanted to get rid of the batch call (and the cumbersome parsing of the results), so i looked at this again.

               

              I think my key issue is what you call "expected" and in that respect the documentation does not give any clues which selectedfields function in which call. Let alone that i understand why there is such a difference.

              Set that aside, i agree the only option is a batch call, as i need to find all the attributes below a specified attribute first (and this i cannot encode WebIDs of all required attributes beforehand).

                • Re: SelectedField Items.Value.Value not returning value
                  jyi

                  The only note I have for you is to take a look at the sample response for each controller. Be it a streamset's GetRecorded or Attribute's GetAttributes call.

                  But I agree with you on the lack of explanation in selected Fields topic. Perhaps it would be more helpful to note the sample requests as well as the sample response?

                  1 of 1 people found this helpful