Skip to main content

How to create a Nested Flow | Power Automate | PowerApps

In this post, let us see how to implement "Nested Flows" in Power Automate. 

Some use cases:

  1. To create a common logic and make use of "Run a Child Flow" action
  2. To perform actions on the database without providing access to the end users.
Let us create records in SharePoint (using Student Name and Email fields in this post) without providing access to the end users using nested flow concept.

To proceed, we need to have two flows created. 

  • Parent Flow (which triggers the child flow)
  • Child Flow (nested Flow)
Go to flow.microsoft.com, log in and select respective environment from the drop-down.

  1. Click on "+ Create"
  2. Choose "Instant flow"
  3. Provide a name and choose "When an HTTP request is received" and "Create"
  1. Now, we need to provide inputs to the flow (inputs from the Parent Flow)
  2. We need to generate Schema for "When an HTTP request is received" trigger
  3. Click on "Use sample payload to generate schema" and upload he schema 

{
    "Student Name":"Power Assist",
    "Email""PowerAssist2020@gmail.com"
}

  1. Next step is to add respective actions, in our case it is "Create Item" in SharePoint.
  2. Click on "+ New step" and add "Create Item"
  3. Select respective "SharePoint Site" and "List" details from the drop-downs
  4. Once the list selected, related fields in the list would get populated.
  5. Go to the required fields, and choose dynamics content and add the values from the "Trigger Body"


  • Now, let us add one more action to send response from Child Flow to Parent Flow
  • So, for that add - "Response" action
  • Under "Body" - add dynamic content from "create item" action


Now, save the flow and create another flow [Parent to call this].

  1. Once the "Child Flow" is saved, you would have observed a new URL generated for the Child Flow's trigger "When an HTTP request received".
  2. Copy the URL and keep it handy, we are going to use it in Parent flow
  3. Click on "+ Create" to create Parent Flow and Select "Instant Flow" [you can chose the required trigger]
  4. I am adding two input values to create items in SharePoint. [Student Name and Email]
  5. Now add "HTTP Request" action and provide the details
  6. Method : "POST"
  7. URI: "Child Flow Trigger URL"
  8. Body: "the values (inputs) to be sent to child flow


  • Add "Response" action next to "HTTP" to capture the outcome from the Child Flow, as we have added in Child Flow

Advantages:

In the Child Flow, configure the actions with required account. So, all the records
would get created with that account, even the user doesn't have access to the Data
Source.

Comments

Popular posts from this blog

Validate an email input in a Canvas Application | PowerApps

Validate an email input in a Canvas Application | PowerApps In this post let us see, how to Validate an email input in a Canvas Application UI Validations helps us to ensure, valid data is received from the End User to complete an operation helps end user to provide right information the validation action depends on the type of the input control for Text Input Control - mostly we go with "OnChange" for check box control - "OnCheck and On uncheck" for Drop Down and Combo Box Controls - "OnChange" or "OnSelect" etc., Now, let us see how can we validate an email input, a phone number input and a name input. How to validate an email input value is valid? We can leverage "Regex" (Regular Expressions) to valid user inputs. Let us consider the Email Input Control Name as -  txtEmail.Text. OnChange of this Control let us i

How to create a "pop-up box" in PowerApps

in this post, let us see how to create a Pop-Up in Canvas App required controls: rectangular icon label buttons - 2 take a "rectangular icon" and make it screen size update it's "Fill" - with RGBA(175, 191, 224, 0.5) . Take another "rectangular icon" and adjust it to center Take "label" - and add required text (Eg: "do you want to proceed?") Take two buttons. Update text of Button1 to "OK" and other to "Cancel" On Click of the respective control (to open the pop-up), add this expression : UpdateContext({locOpenPopup:true}) select "cancel" and "ok" button and add UpdateContext({locOpenPopup:false}) on "OnSelect" property. add appropriate actions on "cancel&quo

Success confirmation on a record submission - Canvas Application

In this post let us see, how to show a successfully submitted record's data back on to the form, as a confirmation. Take two screens  Home Screen Success Screen On Home Screen: Take a Form Control on the Home Screen and map it to respective entity. In this post we are mapping it to Registrations entity. Take a Button Control and input the below expression, to create records into Registrations Entity. SubmitForm( frmRegistration ) Now, let us implement how to redirect the user to Success Message screen to successful record submission. In order to achieve this, we are going to make use of one of the Form Control's properties - OnSuccess. So, OnSuccess we are going to implement Success Screen navigation as below Navigate(' Success Screen ')   Success Screen Take a label to show - success message, as below "Registration was successful. Registration Id: " & frmRegistration .LastSubmit.'Registration Number' LastSubmit  property of a From Control helps u