Select to view content in your preferred language

Add Messages to Analysis Widget

371
6
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?

6 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")

mhaley_stone_env
Emerging Contributor

I am also seeing this bug in the analysis widget. Here is an example (I cannot share the GP script directly) but in the Web App panel I can see all my messages guiding the user as to what is happening in the tool. With the XB analysis widget I can only see the single warning message with no others.

0 Kudos
WeiYing1
Esri Regular Contributor

Thanks all for your feedback!
We are working on enhancing the Analysis widget to customize the message level. It will be available for the coming November release. 

0 Kudos