Power Automate Fundamentals # 4: Usage of rand Function in Power Automate

Introduction:

In Power Automate, in few of the scenarios we need to generate random number example to prepare a unique name with text and combination of Unique number so as to provide a quick test data then rand function is used.

Step 1:

Login to the required Power Apps environment using URL make.powerapps.com by providing user name and password and click on Flows on the left hand side as shown in the below figure.

Step 2:

After Step 1, Click on New Flow and select instant cloud flow and provide the trigger as Manually trigger a flow and click on Create as shown in the below figure.

Step 3:

After Step 2, click on + New Step and under Choose an operation and in text box type compose and select Compose Data Operation as shown in the below figure.

Step 4:

After Step 3, rename compose title with rand Function and click on Inputs and select 2nd tab Expression and type rand and observe it expect 2 parameters first 1 minValue with integer type , 2nd is maxValue of integer type we can pass as shown in the below figure.

Step 5:

After Step 4, rand have the following syntax

rand(minValue: integer,maxValue : integer)

so provide the value as example

rand(1,9999)

and click on OK shown in the below figure.

Step 6:

After Step 5, Save and Test flow after clicking on Run Flow and Done and click on OK shown in the below figure.

Note:

  1. Make sure to save and run the flow whenever you try expressions.
  2. MS documentation is found at https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#rand
  3. As an example, maxValue 9999 as in Step 5, you can provide any other value of your choice.

Conclusion: In this way one can easily generate a random number in few minutes and use it for required scenario.

One thought on “Power Automate Fundamentals # 4: Usage of rand Function in Power Automate

  1. Pingback: Rewind August 2021 – Common Man Tips for Power Platform, Dynamics CRM,Azure

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s