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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Converting Account's A...
Power Pages
Unanswered

Converting Account's Address1:Country/Region column to lookup

(0) ShareShare
ReportReport
Posted on by 323

Hi,

 

We are using Address 1 composite column from the Account table in our multi-step form as shown below. We noted that any address entry in this column also automatically creates a row in the dataverse Address table as well. Now, we have created another custom dataverse table called Countries List and we would like to use the Country Name column as the drop-down on the Country/Region attribute in the composite pop-up. Please let me know how this can be achieved as I am unable to convert the Address 1:Country/Region column to lookup.

 

prathyoo_0-1689327342493.png

 

prathyoo_1-1689327406276.png

 

prathyoo_2-1689327650426.png

 

Categories:
I have the same question (0)
  • Saud Ali Profile Picture
    812 Super User 2024 Season 1 on at

    Hi @prathyoo ,

     

    The Address entity is limited in that one cannot link other entities to it. In other words, there cannot be any relationships created other than what there is OOB.  The Address entity is there for creation of addresses on Accounts and Contacts only.

     

    Thanks,

    Saud

     

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • psreek Profile Picture
    323 on at

    @saudali_25 Thanks. But what is the alternative I have in such a case. The vanilla OOB address entity does not seem to be handy if it cannot be customized.

  • psreek Profile Picture
    323 on at

    We have found a solution that uses liquid code and custom java script to add a drop down to the standard Address1:Country/Region field -

    prathyoo_0-1689951612455.png

     

    We added custom javascript to the step in the multistep form - 

    prathyoo_1-1689951661449.png

     

    This retrieves the country list from another dataverse table and then creates a "Select" html element which is then used to replace the original input element. Here is the script -

     

    {% fetchxml get_countries %}
    <fetch version="1.0" mapping="logical" returntotalrecordcount="true" distinct="false">
      <entity name="cr9f3_countrieslist">
        <attribute name="cr9f3_countryname" />
    <filter type="and">
    <condition attribute="statecode" operator="eq" value="0" />
    </filter>
      </entity>
    </fetch>
    {% endfetchxml %}
    {% assign country_options = '<select name="ctl00$ContentContainer$WebFormControl_6ac70e3d0e0a4dcd9f4b75e894355b76$EntityFormView$address1_country" id="address1_country" class="form-control picklist " onchange="setIsDirty(this.id);"><option selected="selected" value="" label=" " aria-label="Blank"> </option>' %}
    {% for res in get_countries.results.entities %}
    {% assign countryname = res.cr9f3_countryname | escape %}
    {% assign country_options = country_options | append: '<option value="' | append: countryname | append: '">' |  append: countryname | append: '</option>' %}
    {% endfor %}
    {% assign country_options = country_options | append: '</select>' %}

    $(document).ready(function() {
     
    $('#address1_country').replaceWith('{{country_options}}');

    });

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 89 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 75

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard