1

I have couple of columns I want to filter on **1)**Request Type and **2)**Status

Request Type has 7 possible options of which I only want to return values when: A) [Request type] = "Ing Variance" or "Ing Substitution" or "SLE - Ing" .... after I get these results I want to filter further using the [Status] field/column... B) [Status] = 'Declined' or [Status] = 'Complete'

In the end I want to show all records who have any of the three request types which have a status of declined or complete.

I'm finding this difficult to accomplish. Can you help?

Any help would be appreciated.

0

You might have to manually update your views ViewQuery property to make sure the conditions are grouped correctly.

Prepare your CAML query, then update your view to use this query. Example here using PnP PowerShell:

$newview = @"
<Where>
    <And>
        <Or>
            <Eq>
                <FieldRef Name="Request_x0020_Type" />
                <Value Type="Text">Ing Variance</Value>
            </Eq>
            <Eq>
                <FieldRef Name="Request_x0020_Type" />
                <Value Type="Text">Ing Substitution</Value>
            </Eq>
            <Eq>
                <FieldRef Name="Request_x0020_Type" />
                <Value Type="Text">SLE - Ing</Value>
            </Eq>
        </Or>
        <Or>
            <Eq>
                <FieldRef Name="Status" />
                <Value Type="Text">Declined</Value>
            </Eq>
            <Eq>
                <FieldRef Name="Status" />
                <Value Type="Text">Complete</Value>
            </Eq>
        </Or>
    </And>
</Where>
"@
Connect-PnPOnline -Url https://contoso.sharepoint.com/sites/yoursite
$view = Get-PnPView -List "ListName" -Identity "ViewName" -Includes ViewQuery
$view.ViewQuery = $newview
$view.Update()
Invoke-PnPQuery
| improve this answer | |
  • Thanks Rune - let me give this a shot and get back with my update... – Jerry Perez Apr 29 at 15:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.