Applying User Picker to Report Sections

Hi All, 

I'm trying to add a User Picker filter that applies to 4 different sections of a report, all of which are backed by different DSE's or Views. It was suggested to me to use the a!pickerFieldUsers field to do this, so in my Dashboard I added this filter:

 

            a!columnLayout(
              contents: {
                a!pickerFieldUsers(
                  label: "Study Monitor",
                  instructions: "Type any study monitor name",
                  labelPosition: "ABOVE",
                  value: local!studymonitor,
                  saveInto: local!studymonitor
                )
              }
            ),

Then for the first Bar Chart I'm trying to apply the filter to, I added the Rule Input of "selectedStudyMonitors" and wanted to compare this value that's fed in from the Filter selections to the "studyMonitor" field of the view that's backing this Chart like this: 

if(
                isNull(
                  ri!selectedStudyMonitors
                ),
                {},
                a!queryFilter(
                  field: "studyMonitor",
                  operator: "includes",
                  value: ri!selectedStudyMonitors
                  
                )
              )

But I'm getting this error below; I originally tried "=" but it didn't like that operator either. I checked that the data values being returned in both interfaces are the User Names, so something like "first.last" or "monitor.one" etc -- they should match/be able to be compared using either = or includes, right? 

Thanks for any help!

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    Hi I recommend you, try testing your expression rule first, instead of directly testing it via interface.

    Also, may I know what's the typeof right!selectedStudyMonitors variable? Is that of type text, text (Multiple), User , User (Multiple) ?

    Hence best option to debug this issue could be as follows:

    Input the test values into the expression rule (similar as what's being passed via interface with respect to the type) and check whether it's working or not.

    Also, I am a bit curious about, why did you use includes operator, when you are using user picker to fill the value into ri!selectedStudyMonitors variable. Because user picker do not return the partial value instead it returns the username of the selected user. And if the same is stored into DB, then why don't you use "=" operator for your filter criteria?

    Hope this helps.
Reply
  • 0
    Certified Lead Developer
    Hi I recommend you, try testing your expression rule first, instead of directly testing it via interface.

    Also, may I know what's the typeof right!selectedStudyMonitors variable? Is that of type text, text (Multiple), User , User (Multiple) ?

    Hence best option to debug this issue could be as follows:

    Input the test values into the expression rule (similar as what's being passed via interface with respect to the type) and check whether it's working or not.

    Also, I am a bit curious about, why did you use includes operator, when you are using user picker to fill the value into ri!selectedStudyMonitors variable. Because user picker do not return the partial value instead it returns the username of the selected user. And if the same is stored into DB, then why don't you use "=" operator for your filter criteria?

    Hope this helps.
Children
  • Hi thanks for the reply. I was just trying anything to get it to work, hence the includes operator (it was originally = ). I got this to work with the help of a more experienced developer, we added some local variables to save in the selections, then pass these into a link inside of each chart and grid so that the selected choices were both saved up into the filter (so it could be cleared) and drill down the grid to the selected elements.

    Thanks for all the replies and suggestions!