Limiting number of displayed characters for a feature in a report

393
4
03-10-2022 11:47 AM
thoughtsponge1
New Contributor II

I am trying to generate a report on the Survey123 online site and I had a question regarding the formatting of my template.  Is there a way to display a certain # of characters from a feature label, but not the entire label? Let's say the label is "2.3.1 - soil and hydrology".  Is there a way to have the report only show, "2.3.1" and not the entire label?

0 Kudos
4 Replies
Katie_Clark
MVP Regular Contributor

I don't think it's possible to dictate this within the report template itself (as far as I know at least...) but you could have a hidden question in your survey and populate that with the value you want from the report using a custom JavaScript function for string slicing. That's my first thoughts anyway 🙂 

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek
0 Kudos
thoughtsponge1
New Contributor II

It would be much easier if I could figure out how to do an equivalent to the ${feature | getValue: ""} for summary reports.  It works for regular reports, but the moment I try to it in a summary report I get a parsing error when I try to upload the template.

0 Kudos
Katie_Clark
MVP Regular Contributor

I only just made my first summary report a couple days ago, so I'm not used to the nuances specific to that vs. a regular report yet. What specific error are you getting?

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek
0 Kudos
thoughtsponge1
New Contributor II

"Error: An error occurred when checking the report template. Failed to parse ${vent_ | getValue:""} since printing a map/image or accessing attachment binary is not allowed when iterating records inside a summary section."

It's just a string, so I'm confused as to why it can't do it.

0 Kudos