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

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Exporting the relationship type from account entity

(0) ShareShare
ReportReport
Posted on by 38

Hi,

 

I'm trying to export information from the account entity to an on premise database. So far, it exports fine. But I'm having some problems with obtaining the relationship Type Value.

 

When I pick which fields to export, I have 2 options for "Relationship Types" in the dynamic contents section. But neither appears to give me the value of the relationship. For example, I have types like "End User", but when I had a look at what's exported, I either get a number like "6" or some code like "100000001". I was wondering how do I get the actual value of the relationship?

 

Jason

I have the same question (0)
  • Verified answer
    GarethPrisk Profile Picture
    2,826 on at
    Re: Exporting the relationship type from account entity

    That is the integer value of the option set. You're describing the label/text value of the option set.

     

    Option Sets are value-pairings in CDS. This allows you to swap the labels, but maintain the underlying integer value. This integer value can vary. Numbers like 1,2,3 are usually set by MSFT in system fields (or manually by customers/ISVs). Otherwise, the integer value will be set to the publisher's option set value prefix. It will count up from ending in 0, incrementally, as the values are added to the option set.

    https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/customize/types-of-fields#types-of-fields

    https://docs.microsoft.com/en-us/powerapps/maker/common-data-service/change-solution-publisher-prefix

     

    When exporting entities, you will usually want to use the integer value to avoid having to text match. However, this isn't always the case. CDS, especially using the API, will provide both values.

    Your fields would be:

    • customertypecode (int)
    • customertypecodename (label)
  • Jason Yeung Profile Picture
    38 on at
    Re: Exporting the relationship type from account entity

    Hi @GarethPrisk ,

     

    Thanks for your help. When I went to the dynamics content section, I didn't see a customertypecode / customertypecodename to choose from.

     

    I searched around and found the following link:

    https://linnzawwin.blogspot.com/2020/07/get-lookup-display-name-and-option-set.html

     

    It was for the statuscode, but I gather it could be similar for relationshipcode. So I tried plugging in the following to export:

    items('Apply_to_each')?['new_relationshiptype@OData.Community.Display.V1.FormattedValue']

     

    This worked out for me.

     

    Sincerely,

     

    Jason

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 766 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 419 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 235

Last 30 days Overall leaderboard