
Announcements
Hello Everyone,
I'm having a few errors occur with my app and would like to know if anyone can help me troubleshoot this.
I have an app with a pop-up gallery that uses a search text input and two dropdowns to search for records in SharePoint. The search works as it's currently coded and is set up to search for all words with spaces in between them for up to 5 words and the dropdowns filter the results just fine. I have two issues that I need to solve though:
1) I set up a reset button to reset the search text input, and both dropdowns. After a search is performed and a record is selected, if I go back and hit reset, those records will no longer appear in the search. How can I correct this?
Screen - On Visible -
ClearCollect(CollectOwners, {Result: "Filter by Owner"});
ClearCollect(CollectParents, {Result: "Filter by Parent"});
Collect(CollectOwners, Sort(Distinct(SharePointList1, Owner),Result));
Collect(CollectParents, Sort(Distinct(SharePointList1, Parent),Result));
DropDown1 - Items -
CollectOwners
Dropdown2 - Items -
CollectParents
Reset Button - OnSelect -
Reset('Search-OwnerDropDown');Reset('Search-ParentDropDown');Reset('Search-SearchTextInput_1');
Next Arrow - OnSelect -
Set(VarRecord, ThisItem); Set(_popupwindow,false);
SearchGallery - Items -
SortByColumns(
Search(
Search(
Search(
Search(
Search(
If(//all and all
'Search-OwnerDropDown'.Selected.Result = "Filter by Owner" And 'Search-ParentDropDown'.Selected.Result = "Filter by Parent",
SharePointList1,
//all Owners and filtered Parents
'Search-OwnerDropDown'.Selected.Result = "Filter by Owner" And 'Search-ParentDropDown'.Selected.Result <> "Filter by Parent",
Filter(
SharePointList1,
Parent = 'Search-ParentDropDown'.Selected.Result
),
//all Parents filtered Owners
'Search-OwnerDropDown'.Selected.Result <> "Filter by Owner" And 'Search-ParentDropDown'.Selected.Result = "Filter by Parent",
Filter(
SharePointList1,
Owner = 'Search-OwnerDropDown'.Selected.Result
),
//Filtered Owners and PARENTs
'Search-OwnerDropDown'.Selected.Result <> "Filter by Owner" And 'Search-ParentDropDown'.Selected.Result <> "Filter by Parent",
Filter(
SharePointList1,
Owner = 'Search-OwnerDropDown'.Selected.Result And Parent = 'Search-ParentDropDown'.Selected.Result
)
),
Last(
FirstN(
TrimEnds(
Split(
'Search-SearchTextInput_1'.Text,
" "
)
),
1
)
).Result,
"Owner",
" Title",
"Special_ID",
"Country",
"Parent"
),
Last(
FirstN(
TrimEnds(
Split(
'Search-SearchTextInput_1'.Text,
" "
)
),
2
)
).Result,
"Owner",
" Title",
"Special_ID",
"Country",
"Parent"
),
Last(
FirstN(
TrimEnds(
Split(
'Search-SearchTextInput_1'.Text,
" "
)
),
3
)
).Result,
"Owner",
" Title",
"Special_ID",
"Country",
"Parent"
),
Last(
FirstN(
TrimEnds(
Split(
'Search-SearchTextInput_1'.Text,
" "
)
),
4
)
).Result,
"Owner",
" Title",
"Special_ID",
"Country",
"Parent"
),
Last(
FirstN(
TrimEnds(
Split(
'Search-SearchTextInput_1'.Text,
" "
)
),
5
)
).Result,
"Owner",
" Title",
"Special_ID",
"Country",
"Parent"
),
"Special_ID"
)
2) The bigger problem I have is, if I now go in to edit the code in Items from the Search Gallery, even if I just delete a comma or parenthesis and put it back, it causes almost all of the controls on my app to have an error and cannot be reverted back easily. I currently have to perform a Cut of all the code in the gallery, save and exit the gallery, reload the app, and paste all the code back in for it to function again... Not the efficiency I was looking for.
Some of the errors I'm getting appear to be the controls unable to find the VarRecord.'column' (Invalid use of '.') or (Invalid argument type.). And also, the search gallery Next Arrow used to select a record then gets an error red-line under VarRecord that says ('Incompatible type. We can't evaluate your formula because the context variable types are incompatible with the types of variables in other places in your app.')
Thanks in advance!