cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sienna28
Level 8

Unable to get length of string

I'm trying to check if a string variable has a value in it.
The check is done when the loop has finished.
 
The empty check is
empty(variables('<FoundNotFound>'))
 
I am getting an error of
The inputs of workflow run action 'Condition_2' of type 'If' are not valid. The variable '<FoundNotFound>' must be initialized before it can be used inside action 'Condition_2'.'
 
Any help appreciated
 
flow error.PNG
 
 
1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Unable to get length of string

@sienna28 

Try entering true in the expression window.  It looks like you just entered true as text - you must enter it in the expression widow for it to be considered as the true constant rather than just plain text.

In addition, there is an issue with your expression - I will post a suggestion in a moment,

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

9 REPLIES 9
Super User
Super User

Re: Unable to get length of string

@sienna28 

Try entering true in the expression window.  It looks like you just entered true as text - you must enter it in the expression widow for it to be considered as the true constant rather than just plain text.

In addition, there is an issue with your expression - I will post a suggestion in a moment,

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

sienna28
Level 8

Re: Unable to get length of string

Thanks for the tip.

 

I am still getting the error though.

 

flow error2.PNG

Super User
Super User

Re: Unable to get length of string

@sienna28 

The error is complaining that the variable hasn't been initialized - I assume that you have an initialize variable action at the top of your Flow and before the condition - am I correct?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
sienna28
Level 8

Re: Unable to get length of string

I just have it right at the top of the flow.

I thought that would be enough.

It won't allow it to go before the condition - only at the top level.

Super User
Super User

Re: Unable to get length of string

@sienna28 

So, the initialize variable action is before the condition where you reference the variable - correct?

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
sienna28
Level 8

Re: Unable to get length of string

The initialise is the first thing that happens in the flow.

 

I am surprised it is not being picked up further in the flow.

sienna28
Level 8

Re: Unable to get length of string

Solved it.

 

It did not like 
empty(variables('<FoundNotFound>'))

 

so I used a length statement around it.

Super User
Super User

Re: Unable to get length of string

@sienna28 

Don't know why - I tested and had no issues....

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
sienna28
Level 8

Re: Unable to get length of string

It depends where you have it placed.

Where I had it was not acceptable, but anyway I've solved it.

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,730)