Forums

Forums / Developing Portals / TPC Form - Lookup - fetch more attributes than the ID and display Attribute

TPC Form - Lookup - fetch more attributes than the ID and display Attribute

6 posts, 1 answered
  1. Kerillos Kamel
    Kerillos Kamel avatar
    17 posts
    Registered:
    24 Jun 2022
    15 May 2023
    Link to this post
    On lookup fetchxml we can add more attribute to the xml but I want to know how to reteive those Attrributes using JS or whatever to get them populate to the user instead of using saved queries
  2. Eric Mann
    Eric Mann avatar
    59 posts
    Registered:
    16 Oct 2020
    15 May 2023 in reply to Kerillos Kamel
    Link to this post
    Kerillos - are you looking to filter the lookup values based on logged in user? 
  3. Kerillos Kamel
    Kerillos Kamel avatar
    17 posts
    Registered:
    24 Jun 2022
    16 May 2023 in reply to Eric Mann
    Link to this post
    No, I'm not asking on the filteration I'm asking if we could use the lookup Fetchxml to get more attributes of that entity we lookup into it? 
  4. Tom Pawelec
    Tom Pawelec avatar
    25 posts
    Registered:
    21 Oct 2022
    16 May 2023 in reply to Kerillos Kamel
    Link to this post
    Hi Kerillos,

    You can add additional attributes to the fetch manually by clicking build or changing the xml text directly to add the attribute.

    Tom
  5. Kerillos Kamel
    Kerillos Kamel avatar
    17 posts
    Registered:
    24 Jun 2022
    16 May 2023 in reply to Tom Pawelec
    Link to this post
    Yes, I already done this I have added more attributes to the Lookup Fetchxml  but I couldn't figure out how can I get those attribute Using TPC APIs , 
    Ex,  tpc.forms[0].Lookup.get_value() this retarun only it's Guid 
  6. Adam Benoit
    Adam Benoit avatar
    23 posts
    Registered:
    01 Mar 2017
    Answered
    17 May 2023 in reply to Kerillos Kamel
    Link to this post
    Hi Kerillos,

    You need to get the selected dataItem to get the additional attributes:

    tpc.forms[0].<YOUR LOOKUP>.get_kendoInput().dataItem()

    This will return an object with all the attributes from the FetchXML.

    Hopefully this helps,

    Adam
6 posts, 1 answered