Type Convert String value to Int in XPath

1
Hi, Can you help me converting an attribute's value to int. Is there any function that I can use in XPath. e.g: I have the following xpath query. [ProjectID = $SearchValues/Value], Where ProjectID is Int and the Value is string.
asked
1 answers
4

Iqbal,

You can't do that in XPath. If you are in a microflow, you can create a variable and use the parseInteger function to set the value of the variable, then use the variable in your XPath. If you're not in a microflow (maybe XPath on a datagrid source for example) you'll need to solve it a bit differently. Create another attribute on your entity that contains the string equivalent of your product id, then use that new attribute for the XPath. You can populate this new attribute using a before commit event handler that converts the ProjectID to a string using the toString function, and then stores this string in the new attribute.

Hope that helps,

Mike

answered