Select to view content in your preferred language

Add Messages to Analysis Widget

244
4
07-19-2024 06:59 AM
taylorrobinfemadhsgovRobin
Occasional Contributor

I am trying to add messages to the Analysis widget in AGOL Experience Builder that is using a Geoprocessing Service. Previously in Web AppBuilder, if you included arcpy.AddMessage in your script and set the message level to "info" when publishing, that message would show up in the Output box in the Geoprocessing Widget like a print statement. I have not been able to replicate this in Experience Builder's Analysis widget. When I run a tool, it just runs with no messages. The messages are useful for debugging and just letting users know where in the process the script is. For longer running scripts this is especially helpful. Am I missing something or is this functionality not available?

4 Replies
WeiYing1
Esri Regular Contributor

@taylorrobinfemadhsgovRobin ,

Thanks for your feedback. Would you be able to share with us a reproducible gp service? 

Thanks,
Wei

0 Kudos
taylorrobinfemadhsgovRobin
Occasional Contributor

Any GP service with arcpy.AddMessage("Messages....") in the code would be an example. I cannot share one of ours publicly.

0 Kudos
WeiYing1
Esri Regular Contributor

Thank you! We are working on this issue now.

0 Kudos
sxw_eaglegis
Esri Contributor

Yes looks like at the moment only warning and error messages are getting logged in the widget. 

I noticed using the python logging module and set stream output to sys.stderr works, but logs as a warning message e.g.

import logging
logging.basicConfig(level=logging.INFO, stream=sys.stderr, format='%(asctime)s - %(levelname)s - %(message)s')
logging.info("This is an info message")

0 Kudos