Recently one of my colleague asked me about can we hide the sensitive input/output data which we can see in the Power Automate Run History ? This made me search and get the quick response of the available option to achieve it. (which I was really surprised I wasnot using)
So below is a sample Power Automate which i created to showcase this. I created a Instant flow “Run Test Flow” with Input Parameter ”Get Value” and then we will use this value to create a record in table “Custom Test A”
Usually the flow run history of one of the sample run of above flow will look as below-
As you can see you will be able to see the value entered in the field “Get Value” as “Value entered by sid”.
Now we will enable the Secure Input/Output Settings for both the steps added in the above flow considering it to be sensitive information by selecting the steps and click on Settings from ellipsis as below.
After enabling it, we will again run the flow and then open the latest run of the flow. We will see the below screen –
So now you can see that the entered value and the contents in the steps were hidden.
So using above setting we can hide the sensitive data which we don’t want to show in the Flow Run history.
Note- The data is hidden only for the flow runs after the setting is enabled and not for the past runs where the setting was disabled.
Recently we had a requirement to change our existing console application to Azure function. The challenging part here was to use the specific fonts which we had installed in the server machine to run the console application and generate the PDF file in desired Font Format.
We created Azure Function of Timer type to run every 10 minutes and copy the supported code in Azure function. Problem was how to reference the specific Fonts in Azure functions.
In order to make the Fonts available in Azure function we uploaded the required Font files of “.ttf” type as you in the Azure Blob container named “sidcon1” as shown below-
After that we created the Environment Variable “BlobConnectionString” in the Azure Function to store the connection string to get the font file as below-
So we just added below line in the code along with implementation of FontResolver class.
var fontResolver = new FontResolver(connectionString, templateBlobContainerName);
GlobalFontSettings.FontResolver = fontResolver;
One most important thing here I saw was, as the code referenced the FontResolver multiple times we started getting below error in the Azure Functions –
FontResolver – ‘Must not change font resolver after is was once used.’
So after spending couple of hours with the error we figure our that using C# lock mechanism we could get the object set only once, so we added below code to set the GlobalFontSettings as below which ensured that FontResolver was assigned value only once.
(In above code for testing purpose the timer trigger was set to run every 2 minutes)
Below I will add the FontResolver class which I had created in my application to get and set the Fonts from Azure Blob containers while generating PDF
using Azure.Storage.Blobs;
using PdfSharp.Fonts;
using System;
using System.IO;
namespace TrialFunctionApp
{
// Custom FontResolver implementation
public class FontResolver : IFontResolver
{
string connectionString = string.Empty;
string containerName = string.Empty;
public FontResolver(string connectionstring,string containername)
{
connectionString = connectionstring ?? string.Empty;
containerName = containername ?? string.Empty;
}
public byte[] GetFont(string faceName)
{
// This implementation provides Arial font. You can modify it to load your desired font.
if (faceName.Contains("Sarabun"))
{
return FontHelper.GetFont(connectionString,containerName, "Sarabun-Bold.ttf");
}
else
{
return null;
}
}
public FontResolverInfo ResolveTypeface(string familyName, bool isBold, bool isItalic)
{
return new FontResolverInfo(familyName,isBold,isItalic);
}
}
// Helper class to load font data
public static class FontHelper
{
public static byte[] GetFont(string connectionString, string containerName, string fontFileName)
{
// Create BlobServiceClient using the connection string
BlobServiceClient blobServiceClient = new BlobServiceClient(connectionString);
// Get a reference to the container
BlobContainerClient containerClient = blobServiceClient.GetBlobContainerClient(containerName);
// Get a reference to the font file blob
BlobClient blobClient = containerClient.GetBlobClient(fontFileName);
// Download the font file to a memory stream
MemoryStream memoryStream = new MemoryStream();
blobClient.DownloadTo(memoryStream);
// Return the font data as byte array
return memoryStream.ToArray();
}
}
}
The above code ensured that the Fonts were correctly referenced in the Azure functions to generate PDF file.
The PDF generation code remains the standard code as specified by PDFsharp references as below-
In the earlier blog, we have seen how we can use Custom Triggers in the exit criteria so that the customers can exit the journey in between when the trigger is activated.
Today we will see how we can do it using Segments. In the Exit Criteria in Journey we have another option as below –
“Exit by segments” — So once the contact gets added to the selected segment then it should exit the current Journey.- this is the expected behavior. As we are considering the same journey flow as we had in part 1 so I will directly jump into the Segment creation part which we will select in the Exit criteria.
Exit Segment #1–
As per this, the contacts will get added in this Segment when Is Exit Journey = Yes.
So first in our journey the Contacts will flow till it encounters the 15 min wait time, then we will update the Is Exit Journey column of 3 contacts as Yes as below –
Now the 3 contacts will be added in the segment “Exit Segment#1” as you can see below-
Now in our Journey after execution of wait block it will look like below-
4 contacts will move ahead and 3 contacts are exited as it gets added to the “Exit Segment #1” segment.
In this way we can make use of Segments to exit from the Journeys based on respective segments.
Today we will see how we can exit a RTM journey in between using Custom Triggers.
Generally in sales journey we often come across scenarios where after a certain product is bought by the customer then we need to exit that customer from that particular Journey so that the customer won’t receive any similar promotional emails as the customer has already taken up your product, so now there’s no need to send him/her the same follow-up emails.
I am going to use a simple journey to showcase this scenario.
As per above “Customer Tracking Journey #1” – We are targeting specific customers, in our case segment with predefined 7 members. So once they enter the journey next step I have created is a Create Task step to make a task for the customer owner to follow up with them.
After that I have added a wait of 15 minutes so that after 15 minutes it will move to the next step of creating second follow up task for the Contact owner.
Now we will take a scenario where suppose while first follow-up the customer buys the product so now we don’t need to have the second follow-up task i.e. we need the customer to exit from the journey.
Here we will make use of below setting –
In the Journey itself from right hand corner you will see the option to specify the Exit criteria. By Default it uses Complete All Steps. But as we need to use some conditional exit so I am going to select Alternate Exit Option 1 i.e. Exit when a trigger occurs.
In this case I am using below custom trigger –
I am using OOB trigger – i.e. When “Exit Journey” record (related to the contact) is created. So when this record will be created the respective contact should exit the journey.
Once my journey was live it showed below results –
So as you can see here only 4 contacts went ahead after the first wait of 15 minutes and 3 contacts exited the Journey. The 3 contacts exited the journey as I had created 3 Exit Journey records for those contacts as you can see below-
In this example I have used Contact, but similar can be achieved for Lead too. With this approach we can have the customer exit the particular journey based on the Custom Trigger.
Note- Only one thing I am unable to find is the details of contacts exited the particular journey. But as I am using Custom entity to track it, I am able to figure out that details for now.
In the last blog we saw how we can use Custom Triggers to wait in the RTM Journeys and send the data to Azure Service Bus and then executing the “WaitTrigger” using OrganizationService Request move ahead in the Yes branch. Today we will look into another approach where instead of executing the WaitTrigger through code how we can use Dataverse table to serve the purpose.
So first create the custom trigger following below steps –
Go to Dynamics 365 Marketing App — Real Time Marketing Area — Triggers — Click on New Trigger. You will get 2 options-
2. Give name to the trigger suppose “IsAssigned” and select the first option “When a record related to a customer(Contact or lead)” is created or updated, and click Create.
3. Here we need to select the table having lookup of Contact or Lead. In our case we will select Assignment Table as we have lookup of Contact on it. The next thing to select is “When is the trigger activated?” As you can see we can select Create record, existing update or even any of the both. For our scenario we will select “An existing record was updated”
4. After that we will select the attribute on update of which we want the trigger to fire in the options” Which attribute updates should activate the trigger?” which displays the attributes of the selected table. Then click on Ready to Use.
5. After that we will move to the RTM Journey and add the option Respond to Action and select the Wait for – A trigger is activated and Choose the above trigger “IsAssigned”. After that add the condition which it should satisfy like Is Assigned = Yes in our case.
6. Now when the journey is live it will wait for the respective action to get completed i.e. within the time limit specified in the wait condition, in our case it will wait till the IsAssigned trigger is activated. And once the related “Assignment” record is updated the respective customer will flow in the Yes branch as below –
Above example we have given using Contact level audience, same can be achieved even for the Lead level records.
Hence to conclude, this was an alternate approach where using the contact/lead related table itself in the Custom Trigger we can have the wait condition achieved in the RTM Journeys !!