web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / The template language ...
Power Automate
Unanswered

The template language function 'empty' expects its parameter to be an object, an array or a string. The provided value is of type 'Float'.

(0) ShareShare
ReportReport
Posted on by 3,506

I have this expression to check if a SharePoint field of type number is empty, but i am getting this eror:-

 

The template language function 'empty' expects its parameter to be an object, an array or a string. The provided value is of type 'Float'.

 

if(empty(first(outputs('Get_items_Grant_2')?['body']?['value'])?['FirstInstallmentPercentage']),'Not Applicable',mul(variables('varBudget'),first(outputs('Get_items_Grant_2')?['body']?['value'])?['FirstInstallmentPercentage']))

 

 

 

Categories:
I have the same question (1)
  • wskinnermctc Profile Picture
    6,519 Moderator on at

    I thought there was something wrong with the expression from the previous post but I couldn't really tell.

     

    Can you show a screenshot of your flow steps? I can get you the correct expression if I see what you are doing.

  • johnjohn123 Profile Picture
    3,506 on at

    @wskinnermctc this is inside a populate word template action, where i have a SharePoint field of type number named FirstInstallmentPercentage and a variable of type float named varBudget and i want to mutiply the 2 values together, as follow:-

     

    johnjohn123_0-1689790442815.png

     

  • wskinnermctc Profile Picture
    6,519 Moderator on at

    Yes, I want to see more of the flow, like the source "Get Items Grant 2" and if there is an Apply to Each.

     

    Is there a reason you are using Get Items instead of the single Get Item action? 

     

  • johnjohn123 Profile Picture
    3,506 on at

    @wskinnermctc yes i am using "Get Item" because i am querying an custom field and not the Id, but i can be sure that the query will only return one item, here is my Get Items action:-

     

    johnjohn123_0-1689792859020.png

     

  • wskinnermctc Profile Picture
    6,519 Moderator on at

    Ok I think I have it, you need to use the string() expression on the first empty check that way it is checking a string value instead of a number.

     

    if(empty(string(first(outputs('Get_items_Grant_2')?['body']?['value'])?['FirstInstallmentPercentage'])),'Not Applicable',
    mul(float(variables('varBudget')),float(first(outputs('Get_items_Grant_2')?['body']?['value'])?['FirstInstallmentPercentage'])))
  • johnjohn123 Profile Picture
    3,506 on at

    @wskinnermctc still same error:-

     

    The template language function 'empty' expects its parameter to be an object, an array or a string. The provided value is of type 'Float'.

     

    could be that empty only work on arrays not on single values?

  • johnjohn123 Profile Picture
    3,506 on at

    @wskinnermctc ok worked , thanks. but what caused the error ? and why string() fixed it?

  • Verified answer
    wskinnermctc Profile Picture
    6,519 Moderator on at

    I don't know why empty() doesn't work for number/integer/float type values. The message says The template language function 'empty' expects its parameter to be an object, an array or a string. So if you wrap the float value with string() then it is turned into a string which empty() will accept.

     

    It is kind of tricking the empty() expression to work by saying its not a float/number, its a string/text.

     

    I made an example of a number/decimal output from a SharePoint column. Without any changes you can see that the value output is Green signifying that it is a number type value. However, if I wrap it with the string() expression it shows the value output as Black color showing that it is a text/string value.

     

    Compare Number Value to String ValueCompare Number Value to String Value

     

    if(empty(string(first(outputs('Get_items_Grant_2')?['body']?['value'])?['FirstInstallmentPercentage'])),'Not Applicable',
    mul(float(variables('varBudget')),float(first(outputs('Get_items_Grant_2')?['body']?['value'])?['FirstInstallmentPercentage'])))

     

    Hope this helps, I put the expression that works here so you can mark it as the solution,

  • JimSInAz Profile Picture
    17 on at

    Genius.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard