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 'replace' expects its first parameter 'string' to be a string. The provided value is of type 'Null'.

(0) ShareShare
ReportReport
Posted on by 8

Our company migrated to a new tenant and in doing so, all of our flows broke.

 

The following 'replace' functions worked until now and I cannot figure out how to fix them:

 

  • replace(replace(replace(replace(triggerBody()?['Subject'],' ','_'),'#','_'),'+','_'),',','_')
  • replace(triggerBody()?['DateTimeReceived'],' ','_')

 

The error I'm receiving is in the subject line. Please help?

Categories:
I have the same question (0)
  • Paulie78 Profile Picture
    8,422 Moderator on at

    The trigger isn't sending any data for the replace to work with. Take a look at the trigger output in the run history. Perhaps you have moved to a new tenant but you haven't updated the flows appropriately?

  • lorynhope Profile Picture
    8 on at

    Thank you for the suggestion. I am so far outside of my wheelhouse here. I've looked at the trigger output in the run history and am coming up short on where the issue is.

     

    The flow we have takes an e-mail that comes into a shared mailbox, exports it and creates a file in Sharepoint - that's where this is failing. Once the file is created in Sharepoint it inserts a row into a Smartsheet.

     

    If I take all of the replace logic out then the e-mails are mostly blank for subject, sender, etc. when I open them.

  • Paulie78 Profile Picture
    8,422 Moderator on at

    I feel like a broken record, but check the run history, it's the best way to figure out what has gone wrong. Check it at every stage, right from the trigger action. Copy the outputs and put them into something like notepad++ so you can clearly see them. You should be able to see the properties of your inbound email there and that will lead you down the path of doing some meaningful troubleshooting.

  • lorynhope Profile Picture
    8 on at

    Again - I appreciate your help - I have checked the outputs. I'm only looking to replace characters from the e-mail subject and the date/time received - and neither of those fields are null in any of the trigger outputs that I'm looking at.

  • krootz Profile Picture
    458 on at

    @lorynhope the error is saying you have a null value. Is the replace expression inside an Apply to Each loop? if it is, one of the subject must be null. In the history, click on next failed.

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 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard