Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

The runtime value '""' to be converted doesn't have the expected format 'String/uri'.

(2) ShareShare
ReportReport
Posted on by 4
I have encountered an error of which there are already many forum posts about. But i just can't seem to wrap my head around why mine specifically isn't working. I have a Form which when filled out and submitted, should trigger an automation to add to a List. One of the fields in the form is a file upload. This is an optional field, and when the form is being processed it should get the link to the file and put it into the URL field in the list.
 
Right now, I create a variable:
 
check if the length is not empty in order to not error out the 'Parse JSON' action, and if not, to set the previous variable to the link (works fine):
 
and then set the value to the value of the variable if it's not empty, otherwise null
I have tried JUST using the variable, as it should be null if it's empty.
 
The 'if contract supp' condition statement also passes over the 'Parse JSON' and 'set variable' actions as it is a length of 0. There is no way the value shouldn't be null, but i still receive the following error when i try to set the field in my 'Create item' SharePoint Action.
 
I'm not sure what to do. I have read many marked correct answers just suggesting using the if(not(empty()),xxx, null) formula, but it doesn't seem to be working for me.
 
Any pointers in the right direction would be appreciated.
Categories:
  • Pstork1 Profile Picture
    Pstork1 64,839 on at
    The runtime value '""' to be converted doesn't have the expected format 'String/uri'.
    Yes, you would need to create a different format for the action for each of the possible URLs that might be blank.
  • SS-22072055-0 Profile Picture
    SS-22072055-0 4 on at
    The runtime value '""' to be converted doesn't have the expected format 'String/uri'.
    I have 4 optional URL fields. Would i need a create item option for every scenario in that case? 
  • Pstork1 Profile Picture
    Pstork1 64,839 on at
    The runtime value '""' to be converted doesn't have the expected format 'String/uri'.
    I suspect you are using the same Create Item action whether the file is present or not.  That isn't going to work. A null string variable will come out as an empty string.  So when you feed that into the action the action gives you the error because its expecting a URL.  You need to use two separate actions. One should be configured the way this one is now and the other should leave that field blank.

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,508

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,839

Leaderboard