Field has invalid html content

8451
12
08-30-2017 09:17 AM
NathanHeick
Occasional Contributor II

Does anyone know the specific details about the above error message?  I receive it when I try to add features through the REST API for a hosted feature service in AGOL.  The features have a field with one or more HTML hyperlinks as shown below:

<a href="http://domain/custom/GISDrawingLookup.asp?drawingNo=JO-P-0293&searchName=JO-P-0293" target="_blank">JO-P-0293</a>,<br><a href="http://domain/custom/GISDrawingLookup.asp?drawingNo=JO-P-0004&searchName=JO-P-0004" target="_blank">JO-P-0004</a>

The REST API does not like the & and = characters in the URLs.  It does not complain about the HTML, just the use of URL parameters.  When publishing the service from ArcMap, the data is loaded as is into the hosted feature service and displays perfectly.  I have several workarounds ready, but I would like to get the REST API to work using the addFeatures endpoint.  I need to automate updating the service and I would prefer to avoid republishing the service each time, or using Arcade and custom HTML popups.

Thanks,

Nathan

12 Replies
feralcatcolonist_old
Occasional Contributor II

Did this get filed as a bug? I'm trying to over-write services utilizing the ArcGIS API for Python clone_items() and I'm running into this same issue with nulls-- --which is odd, because the initial cloning working without any issues.


Likes an array of [cats, gardening, photography]
0 Kudos
SamSzotkowski
New Contributor III

Thanks for this insight... I had a field with thousands of text values and wasn't sure which was causing the "invalid html content" error.  Turns out it's just as you said.

0 Kudos
ellipsol
New Contributor III

I had a column with <> characters so, within a Pandas dataframe, I used regex to remove those characters. This is for an AGOL feature layer updated every few minutes.

 

df['unit'] = df['unit'].replace('[<>]', '', regex=True)