Select to view content in your preferred language

Make resolved records invisible in Instance Name

837
12
Jump to solution
09-11-2025 09:43 AM
dsinha
by
Frequent Contributor

Hello,

I am almost sure I need to use an IF statement somewhere but my html coding skills are not adequate to figure this out. So looking for help. 

I have the following expression for the instance_name field for my survey

concat ('<font color="green">',${address_physical},'</font>',"; ",'<font color="blue">',format-date(${violation_obs},'%m-%d-%Y'),'</font>',"<br>",'<b>',${issue_label},": ",${resolution_status_latest},'</b>')

The resolution_status_latest field contains various options, including resolved. My colleagues asked me if only those responses that are unresolved appear in the Inbox, i.e. those that have been resolved disappear from the Inbox.

Can someone help? Thanks!

0 Kudos
1 Solution

Accepted Solutions
dsinha
by
Frequent Contributor

Finally found a solution today after trying everything for the last one month and it was counterintuitive, at least to me. The filter works when I used the label value, instead of the name.

What I had overlooked is that the jr:choice-name() function generates the label value, and not the name value. Because resolution_status_latest was calculated using resolution_status_label, which in turn was generated using a jr:choice-name() function, it was producing the label value.

So when I used resolution_status_latest<>'resolved', it did not work because 'resolved' is the name value. When I changed it to resolution_status_latest<>'Resolved' it worked.

 

 

View solution in original post

0 Kudos
12 Replies
Neal_t_k
Frequent Contributor

Sounds like you might want to put a where clause on there, instead of tackling it in the instance name.

 

 resolution_status_latest<>'resolved'

Neal_t_k_0-1757613715374.png

https://doc.arcgis.com/en/survey123/desktop/create-surveys/prepareforediting.htm#ESRI_SECTION1_635E8...

dsinha
by
Frequent Contributor

Thanks @Neal_t_k. However it is not working. Do you think because it is a calculated field (pulls data from a repeat field)?

0 Kudos
Neal_t_k
Frequent Contributor

That's a definite possibility.  You might try to calculate a field in the main form, based when resolved is entered in a repeat, then use that for your where clause?

 

0 Kudos
dsinha
by
Frequent Contributor

Thats how it is set up. The resolution_status_latest field is in the main form where it is calculated based on what is entered in the repeat field.

This is the calculate expression for resolution_status_latest where resolution_status_label is the repeat field:

indexed-repeat(${resolution_status_label},${resolution_steps},${resolution_count})

0 Kudos
Neal_t_k
Frequent Contributor

hmm I don't use this too much, maybe try this:

where=resolution_status_latest<>'resolved'

https://developers.arcgis.com/rest/services-reference/enterprise/query-feature-service/#sql-92-where...clause

Not sure whats going on,  I can't get it to work with '<>' or '!=' but it works with'='

So you could try the opposite, and set it to show when it equals  resolution_status_latest = 'not resolved'

0 Kudos
Neal_t_k
Frequent Contributor

Or you could set it up so that field is NULL until it is 'resolved' and then for your query: resolution_status_latest IS NULL

You could set a hidden helper field to: if(indexed-repeat(${resolution_status_label},${resolution_steps},${resolution_count}),'resolved','resolved','')

The 'is null' work for me in my test

0 Kudos
dsinha
by
Frequent Contributor

Thanks @Neal_t_k. I will try the first solution with '='. I am hesitant to add new fields since my colleagues have already collected data and adding new fields at this stage would delete all existing records. 

dsinha
by
Frequent Contributor

Strangely, when I tried to use = in the where clause, all the records disappeared from the Inbox. I am going to ask Tech Support for help.

Thanks!

0 Kudos
Neal_t_k
Frequent Contributor

@dsinha Well at least it is filtering then, just not filtering right.

One more thing to try:  How about instead of =, use "NOT IN" or "IN"

so something like

resolution_status_latest NOT IN ('resolved')

or conversely

resolution_status_latest  IN ('othStatus1', 'othStatus2',...)

0 Kudos