cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sienna28
Responsive Resident
Responsive Resident

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
ScottShearer
Super User
Super User

@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
ScottShearer
Super User
Super User

@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

Thanks for the tip.

 

I am still getting the error though.

 

flow error2.PNG

@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

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.

@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

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
Responsive Resident
Responsive Resident

Solved it.

 

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

 

so I used a length statement around it.

@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

It depends where you have it placed.

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

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (3,926)