Power Apps – Custom help panes and guided tasks

February 2, 2020 Leave a comment

Custom help panes and guided tasks gives your Unified Interface application a custom in-product help experience that is tailored to your organization.

Custom help panes replace the previous learning path guided learning feature used with legacy web client apps.

How to enable Custom help panes and guided tasks:

  • Open your Power App
  • Using ‘Advanced Settings’, Go to Settings -> Administration

GuideTasks_8

  • Choose “Custom help panes and guided tasks” to ‘Yes’

GuideTasks_1

Configuring Help pane content:

In my example, I am using ‘Fund Raisers’ Model driven app. To configure ‘Help pane content’ for ‘Fundraiser’ entity:

  • Select the ‘Fundraisers’ from the Sitemap.
  • Click on ‘?‘ and from the ‘Help Pane’, select ‘Edit’ option as shown below.

GuideTasks_2

  • Using the Rich text editor, you can configure the rich content.
  • Use ‘Balloon’ option to point to specific UI elements with text.

GuideTasks_4

  • To add ‘Balloon’ on ‘Delete’ button, use ‘Drag to an element‘ option and point to the ‘Delete’ button.

GuideTasks_3

  • Once configured, Balloon would show up as below

GuideTasks_5

  • You can also add Images, Links and Videos.

Moving Help content via Solutions:

  •  If you want to move your content to another environment, first add your existing help pages into an unmanaged solution before you export them.
  • From the ‘Add Exisitng’ components, select ‘Help Page’.

GuideTasks_6

  • Select the available ‘Help content’ records and add to the Solution.

GuideTasks_7

Who can author help pane content:

  • By default, System Administrator and System Customizer security roles both have this privilege.
  • For other security roles, grant Global create, read, write, delete, append, and append to permissions on the Help Page privilege.

Notes:

  • To author custom help panes, you need to be on version 9.1.0.10300 or later.
  • You can enable custom help panes or customizable help, but not both at the same time.
  • Each help pane is unique for these contexts: Application, Entity, Form, Language

Refer here for more details.

🙂

Power Apps Portal – Multi Language – ‘Invalid website language’ error

February 1, 2020 Leave a comment

Other day, while configuring multi language on Power Apps portal, I was getting following error while adding ‘Hindi’ as new ‘Website Language’.

Portal_Lng2

Reason:

  • ‘Hindi’ language was disabled by default in CDS.Portal_Lng5

Fix:

  • From your portal’s ‘Model Driven’ App, go to ‘Advance Settings’, which opens up classic ‘Settings’ sitemap area.

Portal_Lng4

  • Under ‘Settings -> Administration -> Languages‘ select the Language which you want to enable and click ‘Apply’.

Portal_Lng6

  • Now go to the portal’s ‘Model Driven’ App and you should be able to create new ‘Website Language’ with enabled ‘Language’ (i.e., Hindi).

Portal_Lng7

How Multiple Language works in ‘Power Apps Portal’:

  • To enable a new localization (i.e., Language), add a new ‘Localized Content’ record, to every Portal ‘Web Page’.

Portal_Lng8

  • ‘Localized Content’ record will have a ‘Portal Language’ lookup of ‘Website Language’ record.
  • To add ‘Hindi’ localization to the ‘Web Page’ add a new ‘Localization Content’ record with ‘Portal Language’ lookup set to ‘Hindi’ website language (Refer ‘Fix’ section for how part).

Portal_Lng9

  • Make sure ‘Published State’ of ‘Localized Content’ is ‘Published’.

Key Notes:

  • By default a ‘Localization Content’ record pointing to base language (i.e., English in my case) gets created when you create a new ‘Web Page’.
  • Web Link Sets:
    • When a new language is activated , a new set of links are created for the newly activated language.

Portal_Lng11

  • Content Snippets:
    • When a new language is activated , a new set of Snippets are created for the newly activated language.
    • Refer link on usage of ‘Content Snippets’

Portal_Lng10

  • If you activate a new language after enabling Portal, the metadata will not be installed automatically for the newly activated language.
  • To get the metadata translation for the newly activated language, you must import the metadata translation from the Power Apps Portals admin center.

🙂

 

ADX Portal – Prevent URL redirection

January 28, 2020 Leave a comment

Recently our ADX portal underwent Penetration testing (Also called ‘Ethical hacking’) and we got a following recommendation:

Prevent on-domain URL redirection. All URL redirection should be validated to only redirect to approved domains and/or URLs.

Reason:

  • In ADX portal, when ever you signed out or the session expires from a particular ‘web page’, Portal will take you back to the ‘web page’ you were before you signed out.
  • ADX portal achieves this behavior by appending ‘ReturnURL‘ parameter to the URL. ‘ReturnURL’ contains the web page path before you signed out.

ADX_Redirect_2

Whats the harm with this behavior?

  • ADX portal, will try to redirect to the URL formed in ‘ReturnURL’.
  • An attacker can redirect users from portal to a specific URL (Phishing).
    • As an example, attacker can mail you a link with Portal URL along with ‘ReturnURL?myphishingsite.com‘.
    • If the user think, its a genuine Portal URL and sign-in, ADX portal would redirect you the myphishingsite.com as the same was mentioned in ‘ReturnURL‘.

How to handle this in ADX website?

  • We modified the ‘Login’ logic to ignore ‘ReturnURL’ and redirect Users to portal’s Home page always.
  • All we need to do is
    • Set returnUrl=”/” on ‘LoginController.cs -> Login’ function.

ADX_Redirect_1

  • We can also modify the logic to allow redirection only to a set of URLs.

🙂

 

Categories: ADX Tags: , ,

Power Apps – Understanding ‘Variables’

January 26, 2020 1 comment

If you are a ‘Power Apps’ beginner and wonder how to declare and use variables like the way you do in any of your favorite programming language (C#, Java, PHP, etc..) this article is for you.

Before we jump in to ‘Power Apps’ Variables, lets first understand following things:

  • ‘Power Apps’ is different and works more like Excel.
  • Power Apps and Excel both automatically recalculate formulas as the input data changes, without the need of Variables.
  • In below screen,
    • Sum of A and B is being calculated and set to the Label just by summing up the Text values directly like a formula.
    • If either A or B value changes, Label will recalculate the value.

PA_Var1

Why we need variables in ‘Power Apps’?

  • In general, its recommended to avoid using variables in Power Apps.
  • But sometimes only a variable can enable the experience you want.
  • To understand this, lets tweak the previous screen by adding a Button and Sum up the values on button click.

PA_Var2

  • Here we can’t use formulas (i.e., Like screen 1) to calculate the Sum because its value depends on button Click.
  • We require a variable to hold the Sum before its set to the Variable to display.

Types of Variables:

Power Apps has three types of variables:

PA_Var3

Global Variable:

  • You set the value of the global variable with the Set function.
    • Set( Var_Name, 0 ) sets the global variable to a value of 0.
  • Global variables can hold any value, including strings, numbers, records, and tables
  • In my example, on ‘OnSelect’ of ‘Calculate’ button, using ‘Set’ function, I am setting Sum of txt1.Text and txt2.Text to a Global variable ‘globalVar‘.

PA_Var5

  • And setting the ‘Text’ of ‘Label’ to Global variable ‘globalVar‘.

PA_Var6

  •  Global variable scope is ‘App’ level, can be references from anywhere in the app. Which means, I can read the ‘globalVar‘ from a different screen (i.e., Screen2).

PA_Var7

Context Variable:

You implicitly establish and set context variables by using the UpdateContext or Navigate function.

UpdateContext:

  • UpdateContext( { Var_Name: 0} ) sets the context variable to a value of 0.
  • Context variables can hold any value, including strings, numbers, records, and tables
  • In my example, on ‘OnSelect’ of ‘Calculate’ button, using ‘UpdateContext’ function, I am setting Sum of txt1.Text and txt2.Text to Context variable ‘ctxVar‘.

PA_Var8

  • And setting the ‘Text’ of ‘Label’ to Context variable ‘ctxVar‘.

PA_Var9

  • ‘OnSelect’ of ‘Clear Context Variable’ button, I am setting ‘ctxVar‘ to 0.

PA_Var10

  • Context variable set using ‘UpdateContext’ function’s scope is ‘Screen’ level, can only be references with in the screen.

Navigate:

  • You can also set a context variable when you use the Navigate function to show a screen.
  • In the example below, lets add a new button ‘Navigate to Screen2’ and on ‘OnSelect’, navigate to ‘Screen2’ by passing ‘ctxvar‘ as argument.
    • Navigate(Screen2,ScreenTransition.Fade,{ctxvar:txt1.Text+txt2.Text})

PA_Var11

  • On ‘Screen2’ set the Label’s text to ‘ctxvar’.

PA_Var12

  • Run the application, click on ‘Navigate to Screen2’

PA_Var13

  • On the ‘Screen2’ we get ‘ctxvar’ value displayed in label.

PA_Var14

  • Important thing to notice is, Except for Navigate, context variables are limited to the context of a single screen, which is where they get their name. You can’t use or set them outside of this context.

Use Collection:

  • Collection holds a table that is easy to modify.
  • Create and set collections by using the ClearCollect function.
    • You can use the Collect function instead, but it will effectively require another variable instead of replacing the old one.
  • In my example, on ‘OnSelect’ of ‘Add to Collection’ button, collect the ‘txt1.Text’ values to a collection ‘collSum‘ using Collect(collSum,txt1.Text)

PA_Var15

  • We clear the Collection ‘collSum‘ using Clear(collSum) function.

PA_Var16

  • To display the ‘collSum’ values, add a ‘DataTable’ control and set ‘Data source’ to ‘collSum’.

PA_Var17

  • Run the application and keep adding the values. You should see collection values in a table as below.

PA_Var18

Notes:

  • You can see the Variables and Collection on the File menu of your App.

PA_Var19

  • If you give a context variable the same name as a global variable or a collection, the context variable takes precedence. However, you can still reference the global variable or collection if you use the disambiguation operator @[Var_Name].
  • All variables are held in memory while the app runs. After the app closes, the values that the variables held are lost.
  • When the user opens the app, all variables have an initial value of blank.

🙂

 

 

 

 

 

D365 – Shifting from Dynamics Workflow to Power Automate flow

December 11, 2019 Leave a comment

First things first, Microsoft Flow is now Power Automate.

If you are either a dynamics developer or administrator, off late you might have noticed a flashing banner while creating new Process from Dynamics instance.

Flow_Scope_4

From the banner, its clear that Microsoft recommends ‘Power automate flows’ over conventional ‘Process’.

In this article, I am going to cover basics of following items, which helps you in decision making to some extent.

Lets get in to the details.

CDS connector vs Dynamics connector:

When you are creating a flow, you need to choose b/w CDS and Dynamics connector.

The key differentiation when switching from Dynamics ‘Process’ to ‘Flow’ is,

  • With CDS connector you can set ‘Scope’ and ‘Filter Attributes’ but not with Dynamics connector.

Lets understand this with an example.

Create a flow with CDS connector:

  • Connect to your Power automate portal
  • Click on ‘+ Create’ tab and choose ‘Automated flow’

Flow_Scope_16

  • In the new window, choose the ‘Common Data Service’ connector.

Flow_Scope_0

  • Under the ‘Triggers’, select ‘When a record is updated’ trigger.

Flow_Scope_2

  • If you notice, under ‘When a record is updated’, there are ‘Scope’ and ‘Attribute Filter’ options.
    • Scope : Scope decides the affected records up on flow execution. Get more details here.
    • Flow_Scope_1
    • Attribute Filter: If no filtering attributes are set flow will execute on every field updates. Add attribute filters to minimize flow execution, only on specified field updates.
    • Flow_Scope_3
  • Now add an action from the ‘Actions’ list. I’ve added a ‘Create a new record’ action.

Flow_Scope_17

Create a flow with Dynamics 365 connector:

  • Connect to your Power automate portal
  • Click on ‘+ Create’ tab and choose ‘Automated flow’
  • In the new window, choose the ‘Dynamics 365’ connector.

Flow_Scope_13

  • Under the ‘Triggers’, select ‘When a record is updated’ trigger.

Flow_Scope_14

  • This time, under ‘When a record is updated’ there are NO ‘Scope’ and ‘Attribute Filter’ options.

Flow_Scope_15

  • Which means, the flow will trigger on all field updates and there is no provision of ‘Attribute Filter’ in Dynamics 365 Connector.

Automated flow vs Instant flow (i.e., On-demand process):

One of the common questions from Admins is, how can they create an ‘On-demand’ power automate flow similar to conventional ‘On-demand’ workflow. The answer is Instant flow.

Lets see how to create a simple on-demand flow and run.

Create an Instant Flow:

  • Connect to your Power automate portal
  • Click on ‘+ Create’ tab and choose ‘Instant flow’
    • Note: You can also create ‘Instant flow’ from Dynamics application.
    • Go to the entity, from ‘Flow’ menu, click on ‘Create a flow’.

Flow_Scope_18

  • In the new window, choose the ‘Common Data Service’ connector.
  • Under the ‘Triggers’, select ‘When a record is selected’ trigger.
  • Select the ‘Environment’ and ‘Entity Name’
    • Environment: If you want your flow to always trigger based on an event in a specific environment, select that environment or Choose (Default), which will always use the database within the environment in which Power Automate runs.
  • Now add an action from the ‘Actions’ list. I’ve added a ‘Create a new record’ action.

Flow_Scope_8

  • In above screen, I am setting ‘Transaction Audit’ entities ‘Name’ field with concatenating ‘Transactions’ entities ‘Name’ and current date (i.e., utcNow()).
    • Use ‘Dynamic content’ window, to refer the values from Previous step.

Trigger Instant Flow:

  • Connect to Dynamics instance and open the record for which you have flow registered. In my case, my flow registered on ‘Transaction’ Entity.
  • From the ‘Flow’ menu, select your flow.

Flow_Scope_5.PNG

  • Click on ‘Run flow’

Flow_Scope_7

  • Make sure you got the success screen as below.

Flow_Scope_9

  • Now check whether the Action executed. In my example, I am creating a child record (i.e., Transaction Audit)

Flow_Scope_10

Formatting Dates:

If you would have noticed the previous screen, the ‘Name’ field of the ‘Transaction Audit’ was set to UTC date format.

To format the date to your choice, use formatDateTime function in your flow’s ‘Expression’.

Flow_Scope_11

Save and run the flow, you should see the formatted date as below.

Flow_Scope_12

Notes:

  • One more edge CDS connector over Dynamics connector is in terms of execution speed. More details

🙂

 

 

 

 

 

 

 

 

Obsolete Secure Communications Protocol Supported – InfoSec – Fix

December 9, 2019 Leave a comment

Last week our web application (i.e., ADX portal website) underwent Penetration testing (Also called ‘Ethical hacking’) and we got following recommendation:

Disable all affected protocols identified above. If possible, implement TLSv1.3, or TLSv1.2 otherwise.

Reason:

  • In our application’s web server (IIS), TLSv1.0 and TLSv1.1 communication protocols were enabled.
  • TLSv1.0 and TLSv1.1 were deprecated in major browsers as of Q1 2019 and will be disabled completely in early 2020.

Fix:

  • We’ve used IIS Crypto tool to disable TLSv1.0 and TLSv1.1 protocols.
  • IIS Crypto is a free tool that gives administrators the ability to enable or disable protocols, ciphers, hashes and key exchange algorithms on Windows Servers.
  • Download the IIS Crypto GUI tool in your windows server where your application is hosted.

IIS Crypto_1

  • Open the tool and un-check TLSv1.0 and TLSv1.1 options.

IIS Crypto

  • You must restart the server for changes to take effect.

🙂

 

Categories: ADX, Misc Tags: , ,

Dynamics workflow – Unable to set Email ‘Regarding’ field

December 3, 2019 Leave a comment

Other day, while working on a straight forward ‘Send Email’ using a ‘Workflow’, I could not set the ‘Regarding’ field on ‘Email’ form.

Scenario:

  • Create a new custom entity ‘Transaction’.
  • Send an Email when a new ‘Transaction’ record gets created.

So, I created a new workflow on ‘Transaction’ entity and added ‘Send Email’ step.

SendMail_0.PNG

On the ‘Email’ configuration screen, all I could see was a blank ‘Look for:’ field.

SendMail_1

Reason & Fix:

  • ‘Activities’ option was not enabled on the ‘Transaction’ entity.

SendMail_2

  • Enable ‘Activities’ and publish.
  • Go to the workflow and I got the Entity Reference in ‘Look for:’ field.

SendMail_3

Its one of those days where we struggle for trivial problems 🙂

 

Categories: CRM Tags: ,