I have a problem with recognizing and converting Unicode Character (U+200E).
A brief description of the flow:
I take the list from sharepoint
I take the list from sql
I instantiate a variable
I take the values from SQL and store them for the conditions to be checked in the variable.
I check if the item from sharepoint list (Get Items) is already in sql (our previously initialized variable)
code of condition: contains(variables('IMO'),int(items('For_each')?['IMO']))is equal to true
In general, for 99% of records this code works because there are no invisible characters. I wondered for a long time why this one record does not work in condition. When I exported this column I noticed that one record looks like this:
The field on sharepoint from which we take data is a text field. It contains numeric values but that is not important.
In sharepoint list, this record looks normal.
In get items output too:
And my question, is there an easy way to remove the unicode character so that you can fully use the extracted value without worries?
I'm trying to get around the removal of special characters somehow, so that in the future there will be no such errors. I expect someone has a proven method on how to do this.
After reproducing from my end, it was working fine. However, one way to solve this is to use replace
function.
replace(items('For_each')?['sample']['<Path_To_Your_Value>'],'[U+200E]','')
or
replace(items('For_each')?['sample']['<Path_To_Your_Value>'],'\u200E','')
Another way you can try is, instead of converting the value to int, you can iterate through SQL list, in each iteration convert the current item to string and then use contains.