Giter VIP home page Giter VIP logo

Comments (4)

kilasuit avatar kilasuit commented on May 24, 2024 1

@hanielc enclose the query in apostrophe's like the below

 '<Where><Eq><FieldRef Name="ContentType" /><Value Type="Computed">News</Value></Eq></Where>'

else powershell will look to the space in between FieldRef Name as the end of the parameter's value

from pnp-powershell.

erwinvanhunen avatar erwinvanhunen commented on May 24, 2024

Hi,

Yes you can. The Query string is a normal CAML query. The MSDN page about the property is pretty limited unfortunately, https://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.client.viewcreationinformation.query.aspx

You can however find a view in your site that uses a query that is pretty similar to the one you want to build, and then retrieve the query with:

$view = Get-SPOView -List <listname> -Identity <viewname>
$view.ViewQuery

I will update the description of the parameter to state that it is a CAML query.

from pnp-powershell.

erwinvanhunen avatar erwinvanhunen commented on May 24, 2024

I added the additional text in PR #56 . Thanks for bringing this to my attention!

Closing the issue.

from pnp-powershell.

hanielc avatar hanielc commented on May 24, 2024

Thanks for your prompt reply, Erwin. I tried your recommendation and got:

<Where><Eq><FieldRef Name="ContentType" /><Value Type="Computed">News</Value></Eq></Where>

However, it doesn't actually create the filter. Wrapping it in <Query>...</Query> didn't work either.

Any other suggestions?

from pnp-powershell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.