I have a layout that displays a set of traffic accidents at a given intersection and must dynamically update the Primary Street, Secondary Street, From Date, To Date, and counts of injury severity based on the visible points in the map frame.
I have three specific questions:
1) For Primary Street and Secondary Street, how do I display ONLY the attributes for the first row in my table? I am currently getting a list of all distinct Primary and Secondary Streets visible in the map frame.
2) For From Date, how do I display just the oldest date? For To Date, how do I display just the most recent date? Again, I am currently getting a list of all distinct dates visible in the map frame.
3) For injury counts, how can I count different values from the same attribute field? It appears I am not able to use iif() because it is only evaluating one row at a time, instead of treating all the points visible in the map frame as a table to be parsed.
The purpose of this layout is to create a custom print template in Experience Builder. If there is a better way to go about this task as a whole, please let me know that too!
Hi!
This is a really cool project. I think you need different kinds of dynamic text for some of these, and lots of SQL queries, which are supported in certain dynamic text elements.
Based on the information you provided I would try
Does this help at all?
I forgot to clarify, adding a SQL query is separate from the expression builder option. To access it change the Query type from all or visible to Custom query. That exposes the SQL query builder.
I tested the Custom Query option for the counts and, while I was able to filter on the value I needed, it applied the filter to the entire table and not just to the points in the map frame. Any suggestions on how to exclude the values not shown using the SQL query?
Dang it, I forgot you needed only the visible to show up. There isn't currently a way to combine visibility and a SQL query. However, you are working with this for a print template right? There might be some additional things you can do in your custom print template code to make it work. Perhaps @TanuHoque can provide some ideas.
Unfortunately ExB print widget doesn't support dynamic text elements at this point. Until they support this, please check out the below post, and you might find it helpful generate output from your print service with dynamic text element
hi @LDoty
does it work with from print service side with some simple dynamic text elements for you?