Solved

Escape @ in pythonCaller

  • 22 February 2024
  • 2 replies
  • 40 views

Badge +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 ?

icon

Best answer by david_r 22 February 2024, 15:16

View original

2 replies

Userlevel 3
Badge +26

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.

 

Userlevel 5

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