Need help query records to inbox

516
3
Jump to solution
04-22-2022 01:34 PM
JeremieCote
New Contributor III

Hello,

 

I need help building a working QUERY expression to query specific records in the Inbox.

JeremieCote_0-1650659144472.png

I want users to have access to records they created and to records in which their username where selected from a select_multiple question.

So the logic of the second part of the query is that the select_multiple question is called AllowedUsersInbox and it has my users usernames as choices. If the currently logged in user in S123 was selected in the select_multiple question of a record, he will have access to that record to edit via the inbox.

 

With the query in the screenshot I get an error message:

JeremieCote_1-1650659578876.png

How can I make the query works?

Thanks a lot,

Jérémie

0 Kudos
1 Solution

Accepted Solutions
JeremieCote
New Contributor III

I managed to make my query works by reading this post: 

https://community.esri.com/t5/arcgis-survey123-questions/inbox-query-expressions-with-multiple-selec...

 

I took screenshots of my query and xlsforms if you want to see the results:

JeremieCote_0-1651246450706.pngJeremieCote_1-1651246472702.png

 

View solution in original post

0 Kudos
3 Replies
DeonLengton
Esri Contributor

Hi Jérémie

Try Creator=${username} or ${username} IN (AllowedUsersInbox)

The syntax of the IN clause requires a pair of brackets.

0 Kudos
JeremieCote
New Contributor III

Hi!

Thank you I forgot the brackets!

The query now works when I select a single user but doesn't if I select more than one.

The output of my select_multiple question looks like this: John.Smith,Bob.Obama,William.Kurst

I think the usernames sould be separated by a space and put between '' for my query to works.

Is this right?

If yes, is there a function to do that or should I built a custum javascript function?

Thanks again!

0 Kudos
JeremieCote
New Contributor III

I managed to make my query works by reading this post: 

https://community.esri.com/t5/arcgis-survey123-questions/inbox-query-expressions-with-multiple-selec...

 

I took screenshots of my query and xlsforms if you want to see the results:

JeremieCote_0-1651246450706.pngJeremieCote_1-1651246472702.png

 

0 Kudos