I have the following interface with 3 dropdowns. When choices are selected in the dropdown boxes they do not apply to the query to filter out the grid display.
load( local!StatusLabels: {"Active","Inactive"}, local!StatusValues: {"Active","Inactive"}, local!SelectedStatus, local!StatusForFilter: "", local!SelectedPrefix, local!PrefixForFilter: "", local!SelectedPortfolio, local!PortfolioForFilter: "", local!pagingInfo: a!pagingInfo( startIndex: 1, batchSize: 20, sort: a!sortInfo( field: "RequestNumber", ascending: true ) ),a!dashboardLayout( firstColumnContents: { a!sectionLayout( label: "Parameter Selection", firstColumnContents: { a!dropdownField( Label: "Status", instructions: "Select A Status: " & local!StatusForFilter, choiceLabels: local!StatusLabels, placeholderLabel: "---Select Status ---", choiceValues:local!StatusValues, value: local!SelectedStatus, saveInto: local!StatusForFilter ), a!dropdownField( Label: "Request Prefix", instructions: "Please Select a Prefix: " & local!PrefixForFilter , choiceLabels: cons!consGDRSPrefixChoiceLabels, placeholderLabel: "---Select Status ---", choiceValues: cons!consGDRSPrefixChoiceValues, value: local!SelectedPrefix, saveInto: local!PrefixForFilter ), a!dropdownField( Label: "Request Portfolio", instructions: "Please Select a Portfolio " & local!PortfolioForFilter, choiceLabels: cons!consGDRSPorfolioChoiceLabels, placeholderLabel: "---Select Status ---", choiceValues: cons!consGDRSPortfolioChoiceValues, value: local!SelectedPortfolio, saveInto: local!PortfolioForFilter ), } ), a!sectionLayout( label: "GDRS Records", firstColumnContents: { with( local!datasubset: queryrecord( cons!consGDRSRecordTypeforGrid, a!query( selection: a!querySelection(columns: { a!queryColumn(field: "Portfolio"), a!queryColumn(field: "RequestNumber"), a!queryColumn(field: "SubmitterRequester"), a!queryColumn(field: "ActiveInActive"), a!queryColumn(field: "ActualHoursWorked"), a!queryColumn(field: "ActualProductivityHoursSavedMonthlyGD"), a!queryColumn(field: "ActualProductivityHoursSavedMonthlyUPS"), a!queryColumn(field: "ControlType"), a!queryColumn(field: "ControlNumber"), a!queryColumn(field: "State"), }), logicialExpression: a!queryLogicalExpression( Operator: "AND", filters: { a!queryFilter( field: "ActiveInActive", operator: "=", value: local!StatusForFilter ), a!queryFilter( field: "RequestNumber", operator: "starts with", value: local!PrefixForFilter ), a!queryFilter( field: "Portfolio", operator: "=", value: local!PortfolioForFilter ) } ), pagingInfo: local!pagingInfo ) ), a!gridField( totalCount: local!datasubset.totalCount, columns: { a!gridTextColumn( label: "Portfolio", field: "Portfolio", data: index(local!datasubset.data, "Portfolio", null) ), a!gridTextColumn( label: "Request Number", field: "RequestNumber", data: index(local!datasubset.data, "RequestNumber", null) ), a!gridTextColumn( label: "Requester", field: "SubmitterRequester", data: index(local!datasubset.data, "SubmitterRequester", null) ), a!gridTextColumn( label: "Status", field: "ActiveInActive", data: index(local!datasubset.data, "ActiveInActive", null) ), a!gridTextColumn( label: "Actual Hours Worked", field: "ActualHoursWorked", data: index(local!datasubset.data, "ActualHoursWorked", null) ), a!gridTextColumn( label: "Control Type", field: "ControlType", data: index(local!datasubset.data, "ControlType", null) ), a!gridTextColumn( label: "Control Number", field: "ControlNumber", data: index(local!datasubset.data, "ControlNumber", null), links: apply( a!recordLink( label: "Go to record view", recordType: cons!consRecordTypeForFeed, identifier: _, dashboard: "summary" ), local!datasubset.identifiers ) ), a!gridTextColumn( label: "State", field: "State", data: index(local!datasubset.data, "State", null) ) }, value: local!pagingInfo, saveInto: local!pagingInfo ) ) },secondColumnContents: {} ) },secondColumnContents: {}))
Discussion posts and replies are publicly visible
Does your dataSubset value change any when your filters are populated? You can check this via a debug paragraph field as seen in the code i've enclosed. Also, is there any reason you've put your with() there instead of surrounding the whole form, which is a more standard way of doing it? Note that i would expect your way to still work, but just wondering.
And just FYI, if you use the rich text editor, you can choose "insert" and then "code", and present your code in a way that doesn't overinflate your initial post, and preserves formatting.
load( local!StatusLabels: {"Active","Inactive"}, local!StatusValues: {"Active","Inactive"}, local!SelectedStatus, local!StatusForFilter: "", local!SelectedPrefix, local!PrefixForFilter: "", local!SelectedPortfolio, local!PortfolioForFilter: "", local!pagingInfo: a!pagingInfo( startIndex: 1, batchSize: 20, sort: a!sortInfo( field: "RequestNumber", ascending: true ) ), a!dashboardLayout( firstColumnContents: { a!sectionLayout( label: "Parameter Selection", firstColumnContents: { a!dropdownField( Label: "Status", instructions: "Select A Status: " & local!StatusForFilter, choiceLabels: local!StatusLabels, placeholderLabel: "---Select Status ---", choiceValues:local!StatusValues, value: local!SelectedStatus, saveInto: local!StatusForFilter ), a!dropdownField( Label: "Request Prefix", instructions: "Please Select a Prefix: " & local!PrefixForFilter , choiceLabels: cons!consGDRSPrefixChoiceLabels, placeholderLabel: "---Select Status ---", choiceValues: cons!consGDRSPrefixChoiceValues, value: local!SelectedPrefix, saveInto: local!PrefixForFilter ), a!dropdownField( Label: "Request Portfolio", instructions: "Please Select a Portfolio " & local!PortfolioForFilter, choiceLabels: cons!consGDRSPorfolioChoiceLabels, placeholderLabel: "---Select Status ---", choiceValues: cons!consGDRSPortfolioChoiceValues, value: local!SelectedPortfolio, saveInto: local!PortfolioForFilter ), } ), a!sectionLayout( label: "GDRS Records", firstColumnContents: { with( local!datasubset: queryrecord( cons!consGDRSRecordTypeforGrid, a!query( selection: a!querySelection( columns: { a!queryColumn(field: "Portfolio"), a!queryColumn(field: "RequestNumber"), a!queryColumn(field: "SubmitterRequester"), a!queryColumn(field: "ActiveInActive"), a!queryColumn(field: "ActualHoursWorked"), a!queryColumn(field: "ActualProductivityHoursSavedMonthlyGD"), a!queryColumn(field: "ActualProductivityHoursSavedMonthlyUPS"), a!queryColumn(field: "ControlType"), a!queryColumn(field: "ControlNumber"), a!queryColumn(field: "State"), } ), logicialExpression: a!queryLogicalExpression( Operator: "AND", filters: { a!queryFilter( field: "ActiveInActive", operator: "=", value: local!StatusForFilter ), a!queryFilter( field: "RequestNumber", operator: "starts with", value: local!PrefixForFilter ), a!queryFilter( field: "Portfolio", operator: "=", value: local!PortfolioForFilter ) } ), pagingInfo: local!pagingInfo ) ), { a!paragraphField( label: "DEBUG", value: local!dataSubset, instructions: "totalCount: " & local!dataSubset.totalCount, readOnly: true() ), a!gridField( totalCount: local!datasubset.totalCount, columns: { a!gridTextColumn( label: "Portfolio", field: "Portfolio", data: index(local!datasubset.data, "Portfolio", null) ), a!gridTextColumn( label: "Request Number", field: "RequestNumber", data: index(local!datasubset.data, "RequestNumber", null) ), a!gridTextColumn( label: "Requester", field: "SubmitterRequester", data: index(local!datasubset.data, "SubmitterRequester", null) ), a!gridTextColumn( label: "Status", field: "ActiveInActive", data: index(local!datasubset.data, "ActiveInActive", null) ), a!gridTextColumn( label: "Actual Hours Worked", field: "ActualHoursWorked", data: index(local!datasubset.data, "ActualHoursWorked", null) ), a!gridTextColumn( label: "Control Type", field: "ControlType", data: index(local!datasubset.data, "ControlType", null) ), a!gridTextColumn( label: "Control Number", field: "ControlNumber", data: index(local!datasubset.data, "ControlNumber", null), links: apply( a!recordLink( label: "Go to record view", recordType: cons!consRecordTypeForFeed, identifier: _, dashboard: "summary" ), local!datasubset.identifiers ) ), a!gridTextColumn( label: "State", field: "State", data: index(local!datasubset.data, "State", null) ) }, value: local!pagingInfo, saveInto: local!pagingInfo ) } ) } ) } ) )
Well first, let's try moving your with() declaration to the normal place (i.e. just inside the load() declaration). I sorta thought it should work where you had it also, but just for the sake of ease please try this version and let me know if you experience anything different.
load( local!StatusLabels: {"Active","Inactive"}, local!StatusValues: {"Active","Inactive"}, local!SelectedStatus, local!StatusForFilter: "", local!SelectedPrefix, local!PrefixForFilter: "", local!SelectedPortfolio, local!PortfolioForFilter: "", local!pagingInfo: a!pagingInfo( startIndex: 1, batchSize: 20, sort: a!sortInfo( field: "RequestNumber", ascending: true ) ), with( local!datasubset: queryrecord( cons!consGDRSRecordTypeforGrid, a!query( selection: a!querySelection( columns: { a!queryColumn(field: "Portfolio"), a!queryColumn(field: "RequestNumber"), a!queryColumn(field: "SubmitterRequester"), a!queryColumn(field: "ActiveInActive"), a!queryColumn(field: "ActualHoursWorked"), a!queryColumn(field: "ActualProductivityHoursSavedMonthlyGD"), a!queryColumn(field: "ActualProductivityHoursSavedMonthlyUPS"), a!queryColumn(field: "ControlType"), a!queryColumn(field: "ControlNumber"), a!queryColumn(field: "State"), } ), logicialExpression: a!queryLogicalExpression( Operator: "AND", filters: { a!queryFilter( field: "ActiveInActive", operator: "=", value: local!StatusForFilter ), a!queryFilter( field: "RequestNumber", operator: "starts with", value: local!PrefixForFilter ), a!queryFilter( field: "Portfolio", operator: "=", value: local!PortfolioForFilter ) } ), pagingInfo: local!pagingInfo ) ), a!dashboardLayout( firstColumnContents: { a!sectionLayout( label: "Parameter Selection", firstColumnContents: { a!dropdownField( Label: "Status", instructions: "Select A Status: " & local!StatusForFilter, choiceLabels: local!StatusLabels, placeholderLabel: "---Select Status ---", choiceValues:local!StatusValues, value: local!SelectedStatus, saveInto: local!StatusForFilter ), a!dropdownField( Label: "Request Prefix", instructions: "Please Select a Prefix: " & local!PrefixForFilter , choiceLabels: cons!consGDRSPrefixChoiceLabels, placeholderLabel: "---Select Status ---", choiceValues: cons!consGDRSPrefixChoiceValues, value: local!SelectedPrefix, saveInto: local!PrefixForFilter ), a!dropdownField( Label: "Request Portfolio", instructions: "Please Select a Portfolio " & local!PortfolioForFilter, choiceLabels: cons!consGDRSPorfolioChoiceLabels, placeholderLabel: "---Select Status ---", choiceValues: cons!consGDRSPortfolioChoiceValues, value: local!SelectedPortfolio, saveInto: local!PortfolioForFilter ), } ), a!sectionLayout( label: "GDRS Records", firstColumnContents: { a!paragraphField( label: "DEBUG", value: local!dataSubset, instructions: "totalCount: " & local!dataSubset.totalCount, readOnly: true() ), a!gridField( totalCount: local!datasubset.totalCount, columns: { a!gridTextColumn( label: "Portfolio", field: "Portfolio", data: index(local!datasubset.data, "Portfolio", {}) ), a!gridTextColumn( label: "Request Number", field: "RequestNumber", data: index(local!datasubset.data, "RequestNumber", {}) ), a!gridTextColumn( label: "Requester", field: "SubmitterRequester", data: index(local!datasubset.data, "SubmitterRequester", {}) ), a!gridTextColumn( label: "Status", field: "ActiveInActive", data: index(local!datasubset.data, "ActiveInActive", {}) ), a!gridTextColumn( label: "Actual Hours Worked", field: "ActualHoursWorked", data: index(local!datasubset.data, "ActualHoursWorked", {}) ), a!gridTextColumn( label: "Control Type", field: "ControlType", data: index(local!datasubset.data, "ControlType", {}) ), a!gridTextColumn( label: "Control Number", field: "ControlNumber", data: index(local!datasubset.data, "ControlNumber", {}), links: apply( a!recordLink( label: "Go to record view", recordType: cons!consRecordTypeForFeed, identifier: _, dashboard: "summary" ), local!datasubset.identifiers ) ), a!gridTextColumn( label: "State", field: "State", data: index(local!datasubset.data, "State", {}) ) }, value: local!pagingInfo, saveInto: local!pagingInfo ) } ) } ) ) )
Edit: as an aside, I've replaced all of the instances of index(local!dataSubset.data, "fieldName", null) with index(local!dataSubset.data, "fieldName", {}). The only difference this will make is, in my version if you use your filters to filter to zero rows of data, it won't break the grid like it will with the "null"s.
index(local!dataSubset.data, "fieldName", null)
index(local!dataSubset.data, "fieldName", {})
/* logicialExpression: a!queryLogicalExpression( Operator: "AND", */ filter: a!queryFilter( field: "ActiveInActive", operator: "=", value: local!StatusForFilter /* ) , a!queryFilter( field: "RequestNumber", operator: "starts with", value: local!PrefixForFilter ), a!queryFilter( field: "Portfolio", operator: "=", value: local!PortfolioForFilter ) } */ ),
I'll try yours in just a minute. I did make a change so that I was just sending one parameter and used a plain filter instead of a filter expression and it worked with just the one filter. Now I'll try your code.
I just noticed you have this typo in your query expression:
logicialExpression
(should be "logicalExpression")
logicalExpression
[hence my suggestion to get the query working externally before use on your form and/or as an early debugging step ;-)]