web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / FetchXML with Aliases
Power Apps
Answered

FetchXML with Aliases

(0) ShareShare
ReportReport
Posted on by 270

I want to fetch the  value of "su.yomifullname" i.e., PRASANTH, N  from this JSON , The Fetch XML has aliases in it.

This image is the result after executing the JS code.

JayashreeKrish_0-1627307752783.png

 

JS CODE:

JayashreeKrish_0-1627309622283.png

 

Can some one please help to get the value of 'yomifullname' from json ?

I have the same question (0)
  • ChrisPiasecki Profile Picture
    6,428 Most Valuable Professional on at

    Hi @JayashreeKrish,

     

    Can you write out the entire json object to the console to see the structure? When I do a fetch query through the browser I see su.yomifullname present so unless there is an issue with your query then it should be present.

     

    ---
    Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

  • JayashreeKrish Profile Picture
    270 on at

    Hi @ChrisPiasecki ,

    When I print the json object 'result' using console.log(result) , I get

    JayashreeKrish_0-1627313982605.png

    But since su is an alias , I am not able to fetch its value properly.

    However I am able to fetch  teamid and teammembership id since they dont have aliases with them

    Anly help in fetching value with aliases is appreciated. Thanks

  • ChrisPiasecki Profile Picture
    6,428 Most Valuable Professional on at

    Hi @JayashreeKrish,

     

    The dot (.) following the alias will be encoded by its hex value _x002e_ in JSON to avoid conversion errors.

     

    Try accessing by su_x002e_yomifullname

     

    ---
    Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

     

  • JayashreeKrish Profile Picture
    270 on at

    Thanks You , But it didnt work either , It returned undefined

  • EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    Hi @JayashreeKrish,

    You can reference it like this: 

    result.value[0]["su.yomifullname"]

     Hope this helps!

  • JayashreeKrish Profile Picture
    270 on at

    Thanks @EricRegnier This was showing syntax error

  • cchannon Profile Picture
    4,702 Moderator on at

    Is there a reason you are writing the query as a fetch url? This seems like it would be a whole lot easier if you were using the webapi. I put a couple examples below (haven't tested them, so the syntax might not be perfect).

     

    If in client script: 

    Xrm.WebApi.retrieveMultipleRecords("teammembership", "?$select=teamid&$expand=systemuserid($select=yomifullname,domainname)&$filter=teamid/teamid eq "+ GUID).then(
    	(success) => {},
    	(error) => {}
    )

     

    If in a PCF: 

    this._context.webAPI.retrieveMultipleRecords("teammembership", "?$select=teamid&$expand=systemuserid($select=yomifullname,domainname)&$filter=teamid/teamid eq "+ GUID).then(
    	(success) => {},
    	(error) => {}
    )

     

    The reason this will help is that you don't need to alias anything. You just get a properly structured object which you can access with something like "success.entities[0].systemuserid.yomifullname" (again, I haven't tested any of this, so forgive me if I have misspelled anything or messed up syntax somewhere).

  • Verified answer
    JayashreeKrish Profile Picture
    270 on at

    Thanks much. I followed a similar approach.It worked as expected

     

    var entity = "team"
    var select = "?$select=name";
    var filter = "&$filter=name eq 'TeamName' &$expand=teammembership_association($select=fullname,domainname)";
    Xrm.WebApi.retrieveMultipleRecords(entity, select + filter).then(
    function success(result) {
    for (var j = 0; j < result.entities[0].teammembership_association.length; j++) {
    var n = result.entities[0].teammembership_association[j].fullname;
    formContext.getControl("ddi_investigatordetails").addOption({"value" : j+1000, "text" : n});
    }
    },
    function (error) {
    console.log(error.message);
    }
    );

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard