Cannot assign from type ‘System.String’ to type ‘UIPath.Excel.ExcelValue’ in Assign activity ‘Assign’

Im getting the following error in assign activity after using a get text:

“Cannot assign from type ‘System.String’ to type ‘UiPath.Excel.ExcelValue’ in Assign activity ‘Assign’.”

In the assign activity I have the following:

Save to: CurrentRow.ByField(“Precio”)

Value to save: PriceBox.Split(“$”)(2).Substring(0,PriceBox.Split(“$”)(2).IndexOf(“.”)+4)

@Favarelaa - Can you try CurrentRow("Precio") instead of CurrentRow.ByField(“Precio”)?

No i believe its dosent have much to do with that, thank you any ways.

Hi @Favarelaa

Try like this:

priceString As String = PriceBox.Split("$")(2).Substring(0, PriceBox.Split("$")(2).IndexOf(".") + 4)
priceNumeric As Double = Double.Parse(priceString)
CurrentRow.ByField("Precio") = priceNumeric

Hope it helps

Hi @Favarelaa

extractedValue= PriceBox.Split(“$”)(2).Substring(0, PriceBox.Split(“$”)(2).IndexOf(“.”) + 4)
CurrentRow.ByField(“Precio”) = Convert.ToDouble(extractedValue). ToString

@Favarelaa

Can you please delete the assign activity and re add…I did try the same and we see no error

image

cheers

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.