Select to view content in your preferred language

Is it possible to format a repeat in a report without a comma at the end?

1047
4
Jump to solution
02-01-2021 05:51 PM
MikeOnzay
Frequent Contributor

If my repeat contains: 

Charlie Smith

Mali Woods

River Phoenix

Chewy Dogg

${#crews} ${name_label} ${/} - will output: Charlie Smith Mali Woods River Phoenix Chewy Dogg

${#crews} ${name_label}, ${/} - if I add a comma after name label it will output: Charlie Smith, Mali Woods, River Phoenix, Chewy Dogg,

Is there a way to not show that last comma in the report?

0 Kudos
1 Solution

Accepted Solutions
JJ_Reyes
Frequent Contributor

@MikeOnzay - I received some help on this thread: https://community.esri.com/t5/arcgis-survey123-questions/survey123-report-page-break-for-repeat-feat...

This works: 

${#repeat1 | where:"Actions LIKE ‘%sample%’"}

${Your_Field}${if ($feature| getValue:"position")!=(repeat1 | where:"ActionsNeeded LIKE ‘%sample%’ AND ProjectMgmtGUID=’"+ProjectMgmtGUID+"’ AND !important" | stats:"count,objectid")}, ${/}

${/}

This adds the separator when the position is not equal to repeat instance count.

Inside the repeat, you need to get ${repeat...} to very specifically return a count of only the records you want. In my example, I used the GUID that associates the repeats with the parent, as well as another filter. 

On the linked thread you can see the example of using $inputParams instead.

View solution in original post

0 Kudos
4 Replies
Jing_Sun
Esri Contributor

I think a workaround is to add a hidden question in the survey to store the list, using the join() function. 

Put something like this in the calculation: join (",",${name_label})

0 Kudos
JJ_Reyes
Frequent Contributor

@MikeOnzay  - did you find a way get rid of the last comma other than adding a hidden question that Jing_Sun mentioned?

0 Kudos
MikeOnzay
Frequent Contributor

@JJ_Reyes No, I didn't.

0 Kudos
JJ_Reyes
Frequent Contributor

@MikeOnzay - I received some help on this thread: https://community.esri.com/t5/arcgis-survey123-questions/survey123-report-page-break-for-repeat-feat...

This works: 

${#repeat1 | where:"Actions LIKE ‘%sample%’"}

${Your_Field}${if ($feature| getValue:"position")!=(repeat1 | where:"ActionsNeeded LIKE ‘%sample%’ AND ProjectMgmtGUID=’"+ProjectMgmtGUID+"’ AND !important" | stats:"count,objectid")}, ${/}

${/}

This adds the separator when the position is not equal to repeat instance count.

Inside the repeat, you need to get ${repeat...} to very specifically return a count of only the records you want. In my example, I used the GUID that associates the repeats with the parent, as well as another filter. 

On the linked thread you can see the example of using $inputParams instead.

0 Kudos