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

Error when initializing an integer variable with an WDL function

Hi all

I have a string variable called 'HTMLtable' already initialized.

I initialize a second variable, type int, called 'AppsLength'.

I get an error stating the result is a String when I set the initial value to the following 

@sub(length(variables('HTMLTable')),3)

I get the same error when I try the following

@int(sub(int(length(variables('HTMLTable'))),3))

 

 

 

The error message is in Spanish:

La variable "AppsLength" del tipo "Integer" no se puede inicializar ni actualizar con el valor "@int(sub(int(length(variables('HTMLTable'))),3))" del tipo "String". La variable "AppsLength" solo admite valores de los tipos "Integer".

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Error when initializing an integer variable with an WDL function

Hi @efialtes,

 

Could you please share the flow configuration screenshot about where you are trying to put the formula with?

Based on what I know, variables is still not supported under Microsoft Flow, would you please share more details about the steps you are working with?

If you would like to put the formula directly into the Value input of some Action, then no matter how you format the value with WDL function, it will results in a string.

To make it work, please add a Compose Action, then Copy and paste the following:

"@int(sub(length(variables('HTMLTable')),3))"

After that, use the Compose output as the value input.

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Community Support Team
Community Support Team

Re: Error when initializing an integer variable with an WDL function

Hi @efialtes,

 

Could you please share the flow configuration screenshot about where you are trying to put the formula with?

Based on what I know, variables is still not supported under Microsoft Flow, would you please share more details about the steps you are working with?

If you would like to put the formula directly into the Value input of some Action, then no matter how you format the value with WDL function, it will results in a string.

To make it work, please add a Compose Action, then Copy and paste the following:

"@int(sub(length(variables('HTMLTable')),3))"

After that, use the Compose output as the value input.

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

efialtes
Level 8

Re: Error when initializing an integer variable with an WDL function

THank you for your fast response, @v-micsh-msft !

 

I've switched into American English and tried to simplify the formula a bit, tested so far

@length(variables('HTMLTable'))

@int(sub(8,3))

 

The error message is the same:

BadRequest. The variable 'AppsLength' of type 'Integer' cannot be initialized or updated with value '@int(length(variables('HTMLTable')))' of type 'String'. The variable 'AppsLength' only supports values of types 'Integer'.

BadRequest. The variable 'AppsLength' of type 'Integer' cannot be initialized or updated with value '@int(sub(8,3))' of type 'String'. The variable 'AppsLength' only supports values of types 'Integer'.

 

Variables are already supported in Microsoft Flow, as per this screenshot. I also include in it the "initialize variable" action block with the last expression I tested:

 

variables.png

Re: Error when initializing an integer variable with an WDL function

I'm having the exact same problem. Crazy.

Helpful resources

Announcements
firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

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!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Kudoed Authors
Users online (9,510)