| Muhammad Yaseen
To show Navigation Bar according to the web role or according to some other condition
First create the Web Links
Add pages in your Web Link according to your need
We will be using the FetchXml to check for the condition and liquid template for the web roles of the current user and assign navigation bar accordingly
Code inside your header page:
{% assign primary_nav = weblinks["Public Users"] %}
{% if user.roles contains 'Captioner'%}
{% fetchxml CapContactLan %}
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">
<entity name="akouo_language">
<attribute name="akouo_name" />
<attribute name="createdon" />
<attribute name="akouo_code" />
<attribute name="akouo_languageid" />
<order attribute="akouo_name" descending="false" />
<link-entity name="akouo_contact_akouo_language" from="akouo_languageid" to="akouo_languageid" visible="false" intersect="true">
<link-entity name="contact" from="contactid" to="contactid" alias="ab">
<filter type="and">
<condition attribute="contactid" operator="eq" uitype="contact" value="{{user.contactid}}" />
<condition attribute="akouo_interpreteronboarding" operator="eq" value="1" />
</filter>
</link-entity>
</link-entity>
</entity>
</fetch>
{% endfetchxml %}
{% assign CapContactLan_Length = CapContactLan.results.entities %}
{% if CapContactLan_Length.size == 0 %}
{% assign primary_nav = weblinks["Interpreter-Onboarding-Navigation"] %}
{% else %}
{% assign primary_nav = weblinks["Main-Navigation"] %}
{% endif %}
{% elsif user.roles contains 'Project Manager Admin' %}
{% assign primary_nav = weblinks["PMA-Main-Navigation"] %}
{% elsif user.roles contains 'Project Manager' %}
{% assign primary_nav = weblinks["Main-Navigation"] %}
{% endif %}
Join us next time, as we continue our journey of learning canvas apps.Click here to learn more about Imperium's Power Apps Services. We hope this information was useful, and we look forward to sharing more insights into the Power Platform world.