How to generate a random number using Rand() and RandBetween() function in Canvas App

InogicDyn365CE2 years ago6 Views


Introduction

In this blog, we will learn how we can create one random color in RGBA format by generating random numbers.

Problem:

We have a Canvas App, where we have created one Display Form. Here, we have displayed the list of categories of All Accounts in the color-coded format as shown in the below screenshot. In the below screen we want categories of all Accounts to be shown in color-coded format, so it is necessary to display all categories of Accounts in Unique colors. For this, we want to generate random colors for each industry and assign them to a specific category.

Canvas App

Solution:

We can generate the random color using Rand() or RandBetween() function in Canvas App. Please find the below syntax for the above function.

Syntax:

Rand() = This function will generate one random number greater than 0 but less than 1. For example 0.26786, 0.65784.

RandBetween(START_RANGE, END_RANGE) = This function will return the whole number between the range that we provide to the…



Source link

Leave a reply

Join Us
  • X Network2.1K
  • LinkedIn3.8k
  • Bluesky0.5K
Support The Site
Events
February 2025
MTWTFSS
      1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28   
« Jan   Mar »
Follow
Sign In/Sign Up Sidebar Search
Popular Now
Loading

Signing-in 3 seconds...

Signing-up 3 seconds...