cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

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
Highlighted
Super User III
Super User III

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
Highlighted
Super User III
Super User III

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

Highlighted
Helper V
Helper V

Re: Unable to get length of string

Thanks for the tip.

 

I am still getting the error though.

 

flow error2.PNG

Highlighted
Super User III
Super User III

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
Highlighted
Helper V
Helper V

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.

Highlighted
Super User III
Super User III

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
Highlighted
Helper V
Helper V

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.

Highlighted
Helper V
Helper V

Re: Unable to get length of string

Solved it.

 

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

 

so I used a length statement around it.

Highlighted
Super User III
Super User III

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
Highlighted
Helper V
Helper V

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
secondImage

August 2020 CYST Winners!

Check out the winners of the recent 'Can You Solve These?' community challenge!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Top Kudoed Authors
Users online (3,656)