Power Automate Functions - EMPTY Function

Power Automate Functions - EMPTY Function


EMPTY Function

What is an EMPTY function?

EMPTY function return true or false on the behalf of variable values. If the variable keeps no values in it empty function returns true. If initialized variable keeps a value in it, empty function will return false. It is used for all cases like ARRAYS, STRING, AND OBJECTS

Description:

In this guide, we will discuss how to use the float function in power automation. Let us create a new flow. To create a new flow follow the following instructions:

Go to power Apps:

Power Automate Functions - EMPLY Function

Navigate to Flows:
Power Automate Functions - EMPLY Function

Click on the ‘New Flow’ button:
Power Automate Functions - EMPLY Function
After clicking new flow, select ‘Instant Cloud flow’ form the dropdown:
Power Automate Functions - EMPLY Function



Finally set its name and select ‘manually’ as flow trigger point:
In the below screenshot we set the Name of flow and its trigger point which is ‘Manually trigger a flow’. Finally click on the create button to create a new flow. 

Power Automate Functions - EMPLY Function

First, add INITIALIZE VARIABLE ACTION:
To initialize a variable select initialize variable action from the actions set. Then set its properties the same as mentioned in the screenshot.
1# INITIALIZE VARIABLE ACTION
INITIALIZE VARIABLE:
Initialize a variable having the following attributes. 
Name: set variable name
Type: set the type of variable as ‘array’
Value: set values as
Power Automate Functions - EMPLY Function

2# ADD ‘COMPOSE ACTION’ TO CALL EMPTY FUNCTION
CODE:
Empty (variables ('EMPTY FUNCTION FOR STRING'))
If you already assign values to variable EMPTY FUNCTION, return ‘FALSE’. Empty function check the variable if there is any value assigned to variable it will return false
Power Automate Functions - EMPLY Function
OUTPUT:
So we can see empty function returns us a false because there an any value stored in the variable it’s not empty

2# INITIALIZE VARIABLE ACTION
INITIALIZE VARIABLE:
Initialize a variable having the following attributes. 
Name: set variable name
Type: set the type of variable as ‘STRING’
Value: “Walter”
Power Automate Functions - EMPLY Function


ADD ‘COMPOSE ACTION’ TO CALL EMPTY FUNCTION
CODE:
empty(variables('EMPTY FUNCTION FOR STRING'))
If you already assign values to variable EMPTY FUNCTION return ‘FALSE’. Empty function check the variable if there is any value assigned to a variable it will return false
Power Automate Functions - EMPLY Function

OUTPUT:
So we can see empty function returns us a false because there an any value stored in the variable it’s not empty
Power Automate Functions - EMPLY Function

3# INITIALIZE VARIABLE ACTION
INITIALIZE VARIABLE:
Initialize a variable having the following attributes. 
Name: set variable name
Type: set the type of variable as ‘STRING’
Value: empty (null)
Do not assign any value to this variable leave it empty. You can see in the image there is no value assigned to that variable
Power Automate Functions - EMPLY Function
ADD COMPOSE ACTION:
Call empty function in this to compose function. This will check whether you assign any value to a given variable or not. If you assign it will return false and if you leave the value checkbox empty it will return true. Means you variable is really empty
CODE:
empty(variables('NONE VALUE VARIABLE'))
Power Automate Functions - EMPLY Function


Power Automate Functions - EMPLY Function



0 Comments

Thanks for commenting. Your comment will be live soon after approval.