Skip to main content
Solved

Escape @ in pythonCaller


sunsilk11
Contributor
Forum|alt.badge.img+6

Hi I am using FME Form 2021

I am passing a ArcGIS portal login (including domain) as a user parameter

e.g. username@sss.co.uk

 

When I try to get the value in pythonCaller

portalAdmin = str(FME_MacroValues['ArcGIS_Portal_UserName']).strip() 

It is coming as

username<at>sss.co.uk

I am unable to use this to login to my portal in pythonCaller.

 

Any idea how to escape the @ sign ?

Best answer by david_r

Try this:

import fmeobjects

username = str(FME_MacroValues['ArcGIS_Portal_UserName'])
username_parsed = fmeobjects.FMESession().decodeFromFMEParsableText(username)
portalAdmin = username_parsed.strip() 

Documentation: https://docs.safe.com/fme/html/fmepython/api/fmeobjects/_utilities/fmeobjects.FMESession.decodeFromFMEParsableText.html#fmeobjects.FMESession.decodeFromFMEParsableText

View original
Did this help you find an answer to your question?

2 replies

dustin
Influencer
Forum|alt.badge.img+30
  • Influencer
  • February 22, 2024

What type of user parameter, and how is it configured? I was able to recreate your issue using a Text parameter with the HTML editor syntax. However, with a Plain Text (Uniline) syntax the @ symbol comes through as expected.

 


david_r
Celebrity
  • Best Answer
  • February 22, 2024

Try this:

import fmeobjects

username = str(FME_MacroValues['ArcGIS_Portal_UserName'])
username_parsed = fmeobjects.FMESession().decodeFromFMEParsableText(username)
portalAdmin = username_parsed.strip() 

Documentation: https://docs.safe.com/fme/html/fmepython/api/fmeobjects/_utilities/fmeobjects.FMESession.decodeFromFMEParsableText.html#fmeobjects.FMESession.decodeFromFMEParsableText


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings