cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Kudo Kingpin
Kudo Kingpin

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
Highlighted
Community Support
Community Support

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
Highlighted
Community Support
Community Support

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

Highlighted
Kudo Kingpin
Kudo Kingpin

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

Highlighted
Kudo Commander
Kudo Commander

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

I'm having the exact same problem. Crazy.

Helpful resources

Announcements
firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

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!

Users online (10,362)