cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ADH49
New Member

Issue with the standard breadcrumb navigation

Hi Community,

 

I hope you re doing all well.

 

We are facing a problem with the breadcrumb of our Power Portal.

 

To sum up our current configuration, we have an entity list from a custom entity (called : portal account visibility).

This entity list based on a view with related Accounts (relationship N-N)

 

(see screenshot 1) 

 

When we open one of elements from the list, we call a new web page with an entity form (Portal account visibility)

This form contains a grid of accounts (child and great child accounts).

 

(see screenshot 2) 

 

Finally when we click on a record from this entity form, we call again another web page with an entity form (Account), which displays information regarding the selected account.

 

Now, if we want to come back to the entity form Portal Account visibility (with the list of Addresses screenshot 2) by clicking on the breadcrumb element from the Account entity form, we get an error. Actually the breadcrumb doesn't send back the ID of the correct portal account visibility record but the selected Account.

 

(See screenshot 3)

 

We used some liquid tag to provide this ID of Portal account visibility to the web page URL, but we aren't able to load the page without any error.

 

Does anyone know if it is possible to pass an id that does not come from a current entity form in liquid or JS?

 

If you need extra information, do not hesitate to ask me in this post.

 

Thanks a lot !

 

AD.

1 ACCEPTED SOLUTION

Accepted Solutions
ADH49
New Member

Hi Oliver,

 

Thank you for your help !


We have already tried to implement JS but We couldn't retrieve the record ID from entity list.

 

We finally found a acceptable solution in our case.

 

We use a combination between HTML and liquid tags and thanks to a fetch xml.

This is our solution :

{% assign title = title | default: page.title %}
{% if page.adx_partialurl == 'address' %}
{% assign addrId = params.id %}
{% assign acc = entities.account[params.id] %}
{% if acc and acc.parentaccountid %}
{% assign acctId = {{acc.parentaccountid.id}} %}
{% else %}
{% assign acctId = {{acc.id}} %}
{% endif %}

{% fetchxml myquery %}
<fetch version='1.0' mapping='logical'>
    <entity name='customentityid'>
        <attribute name='customentityid' />
        <attribute name="accountid" />
        <attribute name="name" />
        <filter type="and">
            <condition attribute="accountid" operator="eq" value="{{acctId}}" />
        </filter>
    </entity>
</fetch>
{% endfetchxml %}
{% for result in myquery.results.entities %}
{% assign potaccvisId = {{result.customentityid}} %}
{% endfor %}
{% endif %}

<ul class="breadcrumb">
    {% for crumb in page.breadcrumbs %}
    {% assign bUrl = crumb.url %}
    {% if bUrl contains '/addresses/' %}
    {% assign bUrl = bUrl | add_query: 'id', {{potaccvisId}} %}
    <li><a href="{{ crumb.url | add_query: 'id', {{potaccvisId}}" title="{{ crumb.title | escape }}">{{ crumb.title | escape }}</a></li>
    {% else %}
    <li><a href="{{ crumb.url | escape }}">{{ crumb.title | escape }}</a></li>
    {% endif %}
    {% endfor %}
    <li class="active">{% block activebreadcrumb %}{{ title | h }}{% endblock %}</li>
</ul>
 

In this way, we could access to the ID from custom entity and put it in our navigation bar from the current record Account.

 

Thanks again.

 

AD.

View solution in original post

3 REPLIES 3
Fubar
Solution Sage
Solution Sage

After going from Entity List to Web Page, we usually then use Entity Form (rather than another Web Page) as it pops up over the Web Page and doesn't stuff up the navigation.

 

You can probably do what you want by creating your own template and customising your own breadcrumb see the following link for an example https://docs.microsoft.com/en-us/powerapps/maker/portals/liquid/create-custom-template

 

OliverRodrigues
Super User II
Super User II

Hi @ADH49 

you can achieve this by adding a JavaScript at the 3rd (last) page doing the following:

  • Read the referrer URL so you can get the ID of the previous record (document.referrer)
  • Through the URL you can now get the ?id parameter
  • Now in the same JS you can replace the breadcrumbs parameter URL, something like:
$(".breadcrumb").find("a[href='/<your url>/']").attr("href", "<new url>")



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.

Power Apps Portals Super User


Oliver Rodrigues


 

ADH49
New Member

Hi Oliver,

 

Thank you for your help !


We have already tried to implement JS but We couldn't retrieve the record ID from entity list.

 

We finally found a acceptable solution in our case.

 

We use a combination between HTML and liquid tags and thanks to a fetch xml.

This is our solution :

{% assign title = title | default: page.title %}
{% if page.adx_partialurl == 'address' %}
{% assign addrId = params.id %}
{% assign acc = entities.account[params.id] %}
{% if acc and acc.parentaccountid %}
{% assign acctId = {{acc.parentaccountid.id}} %}
{% else %}
{% assign acctId = {{acc.id}} %}
{% endif %}

{% fetchxml myquery %}
<fetch version='1.0' mapping='logical'>
    <entity name='customentityid'>
        <attribute name='customentityid' />
        <attribute name="accountid" />
        <attribute name="name" />
        <filter type="and">
            <condition attribute="accountid" operator="eq" value="{{acctId}}" />
        </filter>
    </entity>
</fetch>
{% endfetchxml %}
{% for result in myquery.results.entities %}
{% assign potaccvisId = {{result.customentityid}} %}
{% endfor %}
{% endif %}

<ul class="breadcrumb">
    {% for crumb in page.breadcrumbs %}
    {% assign bUrl = crumb.url %}
    {% if bUrl contains '/addresses/' %}
    {% assign bUrl = bUrl | add_query: 'id', {{potaccvisId}} %}
    <li><a href="{{ crumb.url | add_query: 'id', {{potaccvisId}}" title="{{ crumb.title | escape }}">{{ crumb.title | escape }}</a></li>
    {% else %}
    <li><a href="{{ crumb.url | escape }}">{{ crumb.title | escape }}</a></li>
    {% endif %}
    {% endfor %}
    <li class="active">{% block activebreadcrumb %}{{ title | h }}{% endblock %}</li>
</ul>
 

In this way, we could access to the ID from custom entity and put it in our navigation bar from the current record Account.

 

Thanks again.

 

AD.

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Users online (82,209)