Unable to store Text Assets with trailing whitespace?

In one of our robots, we are using the value from an Asset in Orchestrator of Text type to select an item from a dropdown menu with a Select Item activity. The problem here is that in the application we’re automating, there is a trailing whitespace at the end of the name of the item the robot is supposed to select. When I add the value to my asset in Orchestrator the trailing whitespace gets trimmed automatically and the robot is not able to find the item it is supposed to select since the name needs to have an exact match.

Is there a way to either keep the whitespace at the end of the Asset value, or retrieve the selectable items and select the closest match instead of an exact match?

HI @manderss

In Select item activity you have used that asset variable in the values field right?

If yes try giving like this

AssetValuevariable+" "

If you know how much spaces will be there you can use it like above

Regards
Sudharsan

@manderss

In your asset instead of space add any other special character and use replace function in your code so that tmrw if a space is removed we can just remove the special character and if extra are added we can add more special characters

Abc(;) - in asset
In your code. Assetvaluevariable.Replace("(;)"," ")

Hope this helps

Cheers

2 Likes

I will try this out. Looks like it’s the option that suits our use case the best. I will get back to this thread with how it goes. Cheers!

1 Like

Implemented this on my robot and it works fine. Semi-colon is a character that never appears on the items we select from so this was a good workaround. Although I’m starting to think there still should be a good way to get the closest match instead of an exact match. Thanks for the tip anyways!

1 Like

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