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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

The template language function 'replace' expects its first parameter 'string' to be a string. The provided value is of type 'Null'

(0) ShareShare
ReportReport
Posted on by 603

Hi all,

 

I'm try to import a lot of records from a Excel table to Dataverse. Some field I need to import to a currency column. Because my Excel have in one of the currency columns ' . ' as delimiter. Because dataverse is not accept that in my environment I add this expression to my flow: 

replace(items('Apply_to_each_|_Create_Project_Activities')?['As Sold Budget Amount'],'.',',')

Good to know, not all the records in my Excel table has values with decimals, so there is not a delimitter. Also some rows don't have a value (column is empty).

 

But my flow is not accepting this. It shows me the following error:

The template language function 'replace' expects its first parameter 'string' to be a string. The provided value is of type 'Null'

 

Does any one know how to fix this?

 

Thanks in advance.

 

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,385 Most Valuable Professional on at

    Replace 

    'Apply_to_each_|_Create_Project_Activities')?['As Sold Budget Amount']

    in your function with 

    coalesce('Apply_to_each_|_Create_Project_Activities')?['As Sold Budget Amount'],'')

     That will replace any null values in the Excel sheet with a blank string.

  • dennisb88 Profile Picture
    603 on at

    Hi @Pstork1 ,

     

    Thank you for your quick reply.

    I just try that, but when I save my flow, it gives an error:

    dennisb88_0-1656594414346.png

    This is the complete (new) expression:

    replace(items(coalesce('Apply_to_each_|_Create_Project_Activities')?['As Sold Budget Amount'],''),'.',',')

      

    I think it's failed because the column where I try to add it is a currency column where a string is not possible, or is it something else?

  • Pstork1 Profile Picture
    69,385 Most Valuable Professional on at

    Sorry, Cut and Paste error on my part.

    replace(coalesce(items('Apply_to_each_|_Create_Project_Activities')?['As Sold Budget Amount'],''),'.',',')

    Coalesce() in Power Automate goes through the arguments from left to right and returns the first non-null argument. So if the value in the row isn't null it will use that.  If the value is then it will replace it with a blank string.

  • dennisb88 Profile Picture
    603 on at

    Hi @Pstork1 ,

     

    Thanks, that don't give me the error by saving the flow.

    But now I got this issue when running the flow:

     

    The 'inputs.parameters' of workflow operation 'Add_a_new_row' of type 'OpenApiConnection' is not valid. Error details: Input parameter 'item/vi_assoldbudgetamount' is required to be of type 'Number/currency'. The runtime value '""' to be converted doesn't have the expected format 'Number/double'.
  • Verified answer
    Pstork1 Profile Picture
    69,385 Most Valuable Professional on at

    Just replace the empty string in the coalesce with a valid default value, like '0'

    replace(coalesce(items('Apply_to_each_|_Create_Project_Activities')?['As Sold Budget Amount'],'0'),'.',',')
  • dennisb88 Profile Picture
    603 on at

    Hi @Pstork1 ,

     

    Thank you. That fixes my issue.

     

    Thanks again and have a nice day.

  • dennisb88 Profile Picture
    603 on at

    Hi @Pstork1 ,

     

    I was a little bit to quick. It seems to be that now every record has the value of €0.- but in my Excel table, not every record is empty. 

    Do you know how that should be fixed?

  • Pstork1 Profile Picture
    69,385 Most Valuable Professional on at

    Can you look at one of the runs and see what value is actually coming out of the replace function?  Also, currency columns in Dataverse are actually lookup columns.  So you may need to add the actual value to a different column.  Currency column explained here:  Column data types in Microsoft Dataverse (contains video) - Power Apps | Microsoft Docs

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 873

#2
Valantis Profile Picture

Valantis 820

#3
Haque Profile Picture

Haque 505

Last 30 days Overall leaderboard