Cloud flows Archives -

Category Archives: Cloud flows

Dynamic Expense Entry Submission with Receipt Attachments in Power Apps: A Practical Implementation for a Texas-Based Operational Technology Security Organization

Blogger CloudFrontsbloggerEdit Profile Summary Expense management processes in enterprise project environments often require strict documentation controls to ensure financial accuracy and compliance. One common requirement is the mandatory attachment of receipts when submitting expense entries, especially for specific expense categories such as airfare, accommodation, or high-value reimbursements. My blog describes how a project-driven organization streamlined its expense submission workflow using Canvas Apps integrated with Dynamics 365 Project Operations. The solution I had implemented automates the validation and submission process for expense entries while ensuring that receipt files are attached before submission. By combining form validation logic in the Canvas App with backend automation using Power Automate, the organization eliminated the manual process of attaching receipts and creating notes in the system. The result was a seamless, user-friendly expense submission experience that enforces compliance while significantly improving operational efficiency. Table of Contents 1. Customer Scenario 2. Solution Overview 3. Understanding the Expense Data Structure 4. Canvas App Validation Logic 5. Expense Creation and Submission Process 6. Automating Receipt Handling with Power Automate 7. Enforcing Mandatory Receipts for Specific Categories 8. Business Impact 9. Solution Walkthrough 10. Final Thoughts 1. Customer Scenario A Texas based Cyber Security organization managing multiple client engagements relied on Dynamics 365 Project Operations to track project expenses incurred by consultants and field staff. While the system allowed users to create draft expense entries, the process of submitting those expenses required additional manual steps. To submit an expense, users had to: Create the expense entry in draft mode. Upload the supporting receipt manually. Navigate to the expense record. Create an associated Expense Receipt record. Attach the receipt file under Notes (Annotations). Convert the file into the required document format stored in the system. Update the expense status to Submitted. This workflow introduced several challenges: Users frequently forgot to attach receipts. Manual creation of Notes records was error-prone. Finance teams had to follow up for missing documentation. Expense approvals were delayed due to incomplete submissions. Employees found the process unnecessarily complex. The organization needed a simpler, controlled way to ensure receipts were always attached when expenses were submitted, without requiring users to understand the underlying system structure. 2. Solution Overview To address these challenges, a custom expense submission experience was built using Canvas Apps integrated working in conjunction with D365 Project Operations. The solution introduced a dynamic expense entry submission interface where users can: Create expense entries Upload receipt files Submit expenses directly from the app Figure: Canvas App interface enabling dynamic expense entry submission with receipt attachment. Figure: Canvas App interface enabling dynamic expense entry submission with receipt attachment. Behind the scenes, the application automatically: Creates the expense entry in Dataverse Generates the related Expense Receipt record Uploads the receipt file to Notes (Annotations) as a document Updates the expense status to Submitted Figure: A Submitted Expense Entry Record. Figure: The Expense Receipt Record + Receipt PDF Annotation associated with the Expense, without which Submission won’t have been possible. This automation completely overrides the manual procedure of attaching receipts and creating notes, ensuring the process is both compliant and seamless for users. 3. Understanding the Expense Data Structure Within Dynamics 365 Project Operations, expense documentation follows a structured relationship model. The hierarchy looks like this: Expense ↓ Expense Receipt ↓ Notes (Annotation) ↓ Blob/Base64 File Storage of Expense Receipt. Figure: Implementation of the Expense Entry -> Expense Receipt -> Annotation -> Receipt File Workflow. In this structure: The Expense record stores the financial transaction. The Expense Receipt record acts as a container for receipt documentation. The Notes (Annotation) entity stores the actual file. The receipt file is stored as Base64 binary data (blob). While this structure is technically sound, it requires multiple manual steps when performed directly by users. The custom Canvas App abstracts this complexity and handles it automatically. 4. Canvas App Validation Logic To ensure all required data is captured before submission, the Canvas App includes dynamic validation logic. The application checks whether essential fields are populated before allowing the expense to be saved or submitted. These validations include fields such as: Transaction Date Project Expense Category Reimbursable Indicator External Comments Unit Quantity Unit Price If any required field is missing, the user receives an immediate notification explaining what needs to be completed. Example logic used in the application: If( Or( IsBlank(DatePicker2_5.SelectedDate), IsBlank(Project_Combobox_5.Selected), IsBlank(ExpenseCategory_Combobox.Selected), IsBlank(Dropdown1.Selected.Value), IsBlank(External_Input_7.Text), IsBlank(Project_Combobox_6.Selected), IsBlank(NumberInput2.Value), IsBlank(NumberInput2_1.Value) ), Notify(“Required fields are missing.”, NotificationType.Error) ) This validation ensures data completeness before the expense record is created. 5. Expense Creation and Submission Process Once validation passes, the Canvas App uses a Dataverse Patch operation to create or update the expense record. The logic dynamically calculates financial values such as the subtotal based on quantity and unit price. Example logic: Set( varSavedExpense, Patch( Expenses, Defaults(Expenses), { ‘Transaction Date’: DatePicker.SelectedDate, Project: Project_Combobox.Selected, ‘Expense Category’: ExpenseCategory_Combobox.Selected, Quantity: Value(NumberInputQuantity.Value), ‘Unit Price’: Value(NumberInputPrice.Value), Subtotal: Value(NumberInputQuantity.Value) * Value(NumberInputPrice.Value) } ) ); ‘SubmitExpense(CanvasApp)’.Run( varSavedExpense.Expense, First(fileupload.Attachments).Name, First(fileupload.Attachments).Value ); Notify( “Expense submitted successfully.”, NotificationType.Success ) This creates the draft expense entry in the system. 6. Automating Receipt Handling with Power Automate After the expense entry is saved, the Canvas App triggers a Power Automate flow. The flow receives: Expense record ID File name Receipt file content The flow then performs the following steps automatically. Step 1: Create Expense Receipt Record A new Expense Receipt record is created and linked to the expense entry. Step 2: Upload Receipt as Note The receipt file is stored as a Note (Annotation) associated with the expense receipt. This note contains: File Name Document Type Base64 encoded file content MIME type Step 3: Update Expense Status Finally, the expense record status is updated from Draft to Submitted. This ensures the expense becomes available for approval workflows and financial processing. 7. Enforcing Mandatory Receipts for Specific Categories An important requirement D365 PO is ensuring that certain expense categories cannot be submitted without receipts. Examples include: Airline tickets Travel expenses Accommodation High-value reimbursements The Canvas App logic ensures that a receipt file must be attached before submission is triggered. If the … Continue reading Dynamic Expense Entry Submission with Receipt Attachments in Power Apps: A Practical Implementation for a Texas-Based Operational Technology Security Organization

Share Story :

Transforming Return Logistics for a USA Manufacturer: Automating Shipment Processing with Dynamics 365 Customer Service

Summary This blog highlights the integration of Microsoft Dynamics 365 Customer Service Hub with FedEx Shipping Manager to handle automated email return shipments for a consumer electronic appliances company based in Massachusetts, USA. In the original process, customer service representatives were required to manually register each return shipment through the FedEx Shipping Manager portal. This process involved copying customer details, creating shipments, generating labels, and capturing tracking numbers — a workflow that typically required 20–30 minutes per request. The integration project automated the entire return shipment process directly within the Dynamics 365 Customer Service Hub. With a single click, the system now registers the shipment using FedEx Shipment APIs, generates a return label, captures the tracking number, and updates the case record automatically. This innovation eliminated the need for agents to switch between systems and reduced shipment registration time from 20–30 minutes to just a few seconds, significantly improving operational efficiency and the overall customer service experience. This blog explains: 1] The operational challenges caused by manual shipment registration. 2] How Dynamics 365 Customer Service Hub was integrated with FedEx Shipping Manager. 3] The functional workflow used to automate shipment creation. 4] How customer service representatives trigger shipments directly from CRM. 5] The business impact achieved through automation and system integration. Table of Contents 1. Customer Scenario 2. Solution Overview 3. Functional Implementation Approach 4. Email Return Label Experience 5. Handling Complex Data Automatically 6. Business Impact 7. Preview Video 8. Final Thoughts Customer Scenario A Massachusetts-based consumer appliance manufacturer known for building innovative kitchen technology was experiencing a growing operational challenge in its customer service operations. As demand for its products increased across major retail channels, the number of customer support cases related to product returns and replacements also grew significantly. The company’s customer support team handled all service requests through Microsoft Dynamics 365 Customer Service. However, when a product needed to be returned for inspection, replacement, or warranty evaluation, agents were required to manually create a shipment in FedEx Ship Manager. This manual process involved several steps: 1] Opening the customer case in the CRM system 2] Copying customer information and shipping details 3] Logging into the FedEx portal 4] Registering the shipment manually 5] Generating a return label 6] Capturing the tracking number 7] Returning to CRM to update the case Each shipment registration typically took 20–30 minutes. When hundreds of return requests were processed weekly, this created several operational challenges: 1] Agents constantly switched between multiple systems 2] Manual data entry increased the risk of errors 3] Customer response times increased, leading to customer resentment 4] Tracking information was not always immediately available in the case record The organization needed a more efficient way to handle returns while keeping the entire process inside their CRM platform. Solution Overview To streamline the returns process, I implemented an integration between Microsoft Dynamics 365 Customer Service and FedEx shipping manager services. The goal was simple: Allow customer service representatives to generate a return shipment directly from the case record with a single click. Instead of navigating to the separate external shipping portal, agents can now initiate a return shipment directly from the CRM case page. Once triggered, the system automatically handles the entire shipment (Email/Return/Label) registration process. With this solution in place, the workflow now looks like this: A customer contacts support regarding a product return via their website, which registers an associated Case record in D365 Case Management (via existing case automation). The support agent opens the case in Dynamics 365. A “Create Return Shipment” button becomes available when the case meets the required conditions, e.g., Case Stage, RMA availability, Region of Customer, etc., thus validating and restricting shipment privileges. With one click, the system registers the shipment with FedEx (via appropriate FedEx Shipment APIs, as per customer requirements). The shipment tracking number is automatically captured and stored in the case record. This tracking number is useful for the customer support team as well as the customer to check the progress of the shipment on the FedEx Shipping Manager portal. The customer receives an email return label that they can print and attach to their package. FedEx Email Return Shipment Process Flow This transformation reduced a 20–30 minute process to just a few seconds. Functional Implementation Approach The implementation focused on simplifying the experience for customer service agents while maintaining strict control over when and how shipments could be created. Intelligent Shipment Trigger Visibility Within the CRM case interface, the return shipment button appears only when specific conditions are met. This ensures that shipments are created only for valid return scenarios. Examples of conditions include: The case must have an approved return authorization The case must be in an appropriate service stage The customer address must be eligible for shipment Required customer information must be available Example: Return Shipment Trigger inside Dynamics 365 Customer Service Hub By embedding these conditions into the CRM interface, agents are guided through the correct service workflow without needing to remember complex procedures. Automated Shipment Creation Once the button is clicked, the system automatically gathers key information from the case record, such as: Customer details Shipping address Product description Return authorization number Contact phone number This information is then used to register the shipment through the FedEx shipping system. The system generates: A unique shipment tracking number A return shipment registration A digital return label The warehouse where the shipment would reach based on the product and end consumer requirement – e.g., return, replacement, or repair of the product Example: A Successful Return Shipment to a specific warehouse. Example: Tracking a Return Shipment using the Tracking No. updated on D365 Customer Service Hub. Example: The FedEx Shipping Manager for Tracking the Integrated Shipments. The tracking number is immediately written back to the case record in Microsoft Dynamics 365 Customer Service, ensuring that support agents can track the return shipment without leaving the case. Email Return Label Experience After the shipment is registered, the customer automatically receives an email containing their return label. … Continue reading Transforming Return Logistics for a USA Manufacturer: Automating Shipment Processing with Dynamics 365 Customer Service

Share Story :

Exposing Plugins as Bound Actions for Power Automate Flows: A Practical Procedure for Efficient Record Processing, involving several records.

In complex business processes, like calculating commissions or validating data across multiple records, applying the same logic repeatedly in a Power Automate flow can quickly become inefficient and difficult to maintain. A more scalable approach is to encapsulate the logic in a Dataverse plugin, expose it as a bound action, and then call this action from a flow. This method centralizes business rules, reduces redundancy, and improves maintainability. In this post, we’ll walk through the steps to implement this approach and examine its advantages over applying the same logic directly within a flow for each individual record. We’ll illustrate this with a practical example from a Houston-based technology consulting and cybersecurity services firm that specializes in modern digital transformation and enterprise security solutions. Flow Diagram Step 1: Create the PluginThe first step is to write a plugin that contains the logic you want to apply to each record. Example: DuplicateCommissionsCounter Step 2: Expose the Plugin as a Bound ActionInstead of running plugin logic manually for each record, you can register it as a bound action in Dataverse. Procedure: E.g. 2. Attach your plugin to this action. Outcome: This exposes your plugin logic as a reusable, callable bound action. Any process or flow can now invoke it for a specific invoice record. Step 3: Use Power Automate to Call the Bound ActionOnce the plugin is exposed, you can loop through multiple records in a flow and call the action. Procedure in Power Automate: This approach ensures that all complex logic resides in the plugin, while the flow orchestrates which records need processing. Advantages Over Logic Directly in the Flow To conclude, exposing plugins as bound actions is a robust, maintainable way to apply complex logic across multiple records in Dataverse. It allows Power Automate flows to focus on orchestration rather than logic execution, leading to cleaner, faster, and easier-to-manage solutions. We hope you found this blog useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfronts.com

Share Story :

Trigger Power Automate Flow using JavaScript – Bi-Directional

Hi All,  This blog will be a continuation of my previous blog –  Trigger Power Automate Flow using JavaScript – Uni Directional Now, feedback is essential when sending a request to determine whether it was successfully performed or failed somewhere.  You can accomplish this by forwarding a response back from where the flow was invoked.  I’ll use the same situation as in my previous blog, where I send a notification by greeting a person’s name if exists, or else I will greet a friend.  Check out my previous blog to learn how to build your Flow and JavaScript.  Steps to pass the response back within Flow​  Step 1: Add a response that will be sent back from where the Flow was invoked.  Quick Tip: I am checking if ‘Name’ is present in my dynamic content. If yes, then greet the person else greet a Friend  Formula: if(contains(triggerBody()?[‘DynamicData’], ‘Name’), triggerBody()?[‘DynamicData’][‘Name’], ‘Friend’)  Steps to add into the JavaScript Step 1: Initially we created JS to trigger the flow, now we will add the code snippet to accept the response from Flow. Add the following Code: Step 2: Trigger the JS and watch the output I get as Alert (I have used the console page to trigger my JS for example purposes) Hope this helps in achieving a response from the Power Automate Flow!

Share Story :

Trigger Power Automate Flow using JavaScript – Uni-Directional

Hi All, Did you know you can use JavaScript to trigger Power Automate flows and pass input data? So, I’ll show you how to do that, as well as how to pass strict structured data and dynamic schema in Power Automate. In the next blog, I’ll talk about Trigger Power Automate Flow using JavaScript – Bi-Directional Steps to follow for Initial Setup Step 1: Let’s create a Power Automate Flow and define the input JSON schema.Go to: Power Automate Create an Instant Flow with the trigger ‘When a HTTP request is received‘ Step 2: Let’s outline the input schema and then focus on the output in a ‘Compose’ block. I’ll describe two types of inputs. (Strict and Dynamic).Our strict schema will be identified by a specific pattern indicating how the input should be given.Our dynamic schema will be recognised by an unknown pattern, and input will not always be fixed. Click on ‘Use sample payload to generate schema’. Apply the following code, click on Done and you will see the schema in ‘Request Body JSON Schema’. Add a Compose Block to check the output of the request and save the Flow. URL will be generated and is ready to be used. Let’s now proceed to create JavaScript to trigger this flow Steps to follow for calling Flow using JavaScript Since I’ll show the code snippet, adjust it as per your use case. Note: Copy your HTTP Post URL from the trigger as it will be used in the JavaScript Step 1: Type the following code Step 2: Execute the JS with ‘TriggerFlow.Main()‘. Note: Make sure you pass Execution Context to the JS Step 3: Check your Power Automate Flow History and open the Run. That’s how Power Automate is triggered using JavaScript. Hope this has helped you 🙂 Next blog – Trigger Power Automate Flow using JavaScript – Bi-Directional

Share Story :

Remove duplicate values from an array using Power Automate Flow

Hello everyone! In this blog, we will demonstrate how to schedule a flow that sends emails to all the owners of opportunities using Power Automate Flow. Scheduled flows are the best option for actions that need to be automated on a schedule and will run at a specific time or date. For instance, using this approach, you might schedule a daily data upload to Dynamics 365 or SharePoint. Use Case: Power Automate flow sends a reminder notification to the owners of Opportunities. To avoid multiple emails being sent to the same owner, we need to remove duplicate email addresses. Step 1: Log in to the required Power Apps environment using URL make.powerapps.com by providing username and password, click on Create on the left-hand side as shown below, and click on Scheduled cloud Flow. Step 2: Mention the date and time. It will appear as this. Step 3:  Initialize a variable ‘Email_addresses’ of type Array which will store all the email addresses. Step 4: Use List Rows to find the desired records from the required table. Select the table name. Also, I added the FetchXML code to fetch the required details of an entity. Step 5: Add an ‘Apply to Each’ loop and insert the previous step’s value. This is done so that the value in every iteration is stored in the Array Variable. Add a step of ‘Set variable’ to store the email addresses in the Array. Step 6:  Add a new step ‘Compose’ and declare an empty array. This helps to save time when comparing with larger sets. Step 7: Apply the Union function which removes duplicate values. union(variables(‘Email_addresses’),outputs(‘Empty_Array’)) Step 8: Apply the Join function to extract the email addresses. join(array(outputs(‘Union_function_to_remove_duplicate_mail_Values_in_Array’)),’,’) Hope this helps!

Share Story :

Set multiple not resolved Email Ids as To Party CC Party & Bcc Party in D365 Email Message records using Cloud flows

Many a time it happens that we need to send emails that may be an email notification etc. to clients, with the power automate capabilities we can schedule, trigger, manually run, and do want not to automate these notification emails.  But the road blocker to all of these is not resolved email IDs, i.e. email IDs that cannot be resolved as Contacts, Accounts, Users in CRM.  We need to make changes to system settings to allow messages to these unresolved Id we have already covered this in the Blog : [https://www.cloudfronts.com/power-automate/send-email-to-not-resolved-email-ids-from-workflow-cloud-flows/]  In this blog let’s see how we can set multiple not resolved Email Ids as To Party CC Party & Bcc Party in D365 Email Message records using Cloud flows  ToParty, CCParty, BccParty are all Activity Parties and they have a ParticipationTypeMask integer value associated with them more on Activity Parties and Types in this link [https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/activityparty-entity?view=op-9-1]  ParticipationTypeMasks are as below :   Sender : 1   ToRecipient: 2  CCRecipient: 3   BccRecipient: 4  In Cloud flow create a new email record, click on “Switch to Input entire array”, populate the email in the address used field and ParticipationTypeMasks as shown below :    Hope this helps!   Thank you 

Share Story :

Get year from Current date & Time function in Cloud Flows

We wanted to get the current year but there is no direct expression only to get the year. Below is the solution where we get the current year. Use formatDateTime function function with Utcnow(). Below is the expression we used. formatDateTime(utcNow(),’yyyy’) Output – Expression to get current date formatDateTime(utcNow(),’dd’) 2. Expression to get the current Month formatDateTime(utcNow(),’MM’) Hope this helps!

Share Story :

Creating HTML table using Power Automate

The Create HTML Table action in Power Automate is a useful tool, but lacks any formatting or styling options. In this blog, we’ll see how to create a HTML table in Power Automate. Use Case: When quote is marked as won, close opportunity as won and send Email to the owner of the Opportunity with below details –  Email Subject – Opportunity Won! Email Body – Customer Name –  Below Table- Solution:Step 1-The requirement is quote should be modified and marked as Won. Trigger on When Quote Modified. Step 2- Initializing the customer with variable actions Step 3- Put a condition that the trigger works only when quote is Won (status code=4), then change opportunity to Won. Step 4- On quote status marked as Won, update the opportunity as Won. Step 5- Listing Accounts associated with Opportunity Step 6- Use Compose: Data Operation and enter the required record URL. Edit the Id by entering the opportunity Id from dynamic content. Similarly for quote URL details as well. Step 7- Using select operation to create a required table in the given format. Using href tag place the outputs of opportunity link and quote link in the key section respectively. Step 8- Create a HTML table and enter the output table of select operation. Step 9- Create 3 new steps using Compose operation to remove the unrequired part of the URL using replace expression. Step 10- Create a new step using compose operation and enter the required CSS style for the table to be sent in the mail and attach the final output in the inputs. Step 11- Send an Email and enter the final output in the Email body. Step 12- Email sent This is how we create HTML table in Power Automate. Hope this helps!!

Share Story :

[Solved] The supplied reference link is invalid in Cloudflows

Introduction: When we add a new row in dynamics CRM, we might end up using the lookup data reterived in previous action. There might be times when the previous record has returned a null. In such cases we get the error- {   “error”: {     “code”: “0x0”,     “message”: “The supplied reference link — contacts() — is invalid. Expecting a reference link of the form /entityset(key).”   } } For this example; I was creating a new record and wanted to use the Account and its contact as lookup in my new record. The reterived Account did not have a contact and so my flow failed. Solution:  Use the below if condition, In this condition- we are checking if the reterived contact is empty, if yes we are setting the lookup field to blank else we are setting the lookup value. Note: Please remove and add the quotes/ commas again ; if you are copy pasting the condition in your flow else it might show invalid expression.

Share Story :

SEARCH BLOGS:

FOLLOW CLOUDFRONTS BLOG :


Categories

Secured By miniOrange