SharePoint HTTP Web service - sharepoint

I'm designing a workflow in SharePoint designer that uses a HTTP web service step via GET method. I have used it successfully before but this time I think the issue is with the name of the list but I'm not sure how to fix it.
Now the original name of the list "Engineers' Items-Table". As you can see, there's an apostrophe in the name. So initially I tried the following url which returned 0 records:
https://<domain>/_api/web/lists/getbytitle('Engineers' Items-Table')/items/?$select=Id
Then I renamed the list to "Engineer Items-Table" and tried the url:
https://<domain>/_api/web/lists/getbytitle('Engineer Items-Table')/items/?$select=Id
which doesn't return any results either. I tried using escape character %27 instead of the apostrophe which is not working either. SharePoint doesn't throw any exception. Workflow completes without an issue but without returning any items from the list.
Really appreciate your input. Thanks.

Instead of using "%27" use " ' " as escape character.
https://<domain>/_api/web/lists/getbytitle('Engineers'' Items-Table')/items/?$select=Id
Renaming the list might not change the behaviour because what you'll be changing now will be only the display name.
Next keep the query simple remove select as a start once you start getting result add select and filters.
Use POSTMAN which is a Chrome extension helps you find the error quickly.

Related

SharePoint: Search box not using search settings

I'm having a problem that just randomly occured, and I have no idea what caused this and how to fix it.
So I have a searchbox that is supposed to use my search settings. Here are my current search settings:
Settings
Settings 2
My problem is that even though I configure my searchbox to use this sites' search settings, it ignores it. Instead of using /results.aspx?u={searchboxQuery} as specified in the settings, it uses /results.aspx?k={searchboxQuery}
I'm also using a custom Result Source:
{searchboxQuery} Path:https://mypage/Pages
The searchbox works if you provide exact matches, but if you try to shorten a word, no result is displayed. The result query itself works correctly, displaying all the correct pages, but not with search queries.
Any help would be highly appreciated, it's quite an annoying problem
I remember running into this a while back. I ended up using a Search Results template from the Pages library (Publishing needs to be turned on. Trying to create the connections myself was too much of a headache.

how to modify _xspAppSearchSubmit on Application Layout Xpages

Im trying to modify search parameter in Application Layout Search, to accept dot(.) as literal part of search item for filtering a view..
for example...
"Mr. Smith" will not show up in the view, but
"Mr.Smith" will..
digging deeper with google debugger, I found the function _xspAppSearchSubmit where I can simply change the code encodeURIComponent(val) into encodeURIComponent(val.replace(/s+\.s+/g,'')
which worked when i tested on console. The s+ to remove spaces, \. to keep the dot as literal.
BUT somehow, I cannot find this function in the ApplicationLayout1 custom control, and listed only one event - onItemClick.
Is it possible to add an "onChange" event?
There's an option and optionParam property there but not sure how to apply this.
Im a newbie with xpage and this control, can someone help me work around this, I've checked other sites about this but doesn't explain this kind of issue. I've also checked encodeURIComponent functionality, but it still interprets dot as command. I also learned this dot works like * wildcard.
the Application Layout is ccBaseUI from "One UI", and setup Basic Application Configuration.
code snippet capture

Search Result Source by ContentType causes zero results

I am trying to build a SP 2013 Result Source that returns my specific content type. Using the Build Tool I have this Query Text:
{searchTerms} ContentType:0x0120D520001F10DE640DA39D48A542F16414CE507B*
Which returns nothing. I have run a full crawl and have items of that content type in my site.
I noticed that when switching to the Test tab of the Build Your Query page the search query is modified somehow into this:
ContentType:0x0120D520001F10DE640DA39D48A542F16414CE507B* -ContentClass=urn:content-class:SPSPeople
I am not liking the addition of the -ContentClass as it appears may be messing things up a bit.
What must else I do to get this to return?
Thanks
I changed it to this and now it works. I have no idea why the builder uses the GUID and why it wont work.
{searchTerms} ContentType:"Engineering Project"

SSRS inserting duplicate query string parameters on Action links

I am working with an SSRS report, and I'm trying to build links to SharePoint list items through an expression on the Action of a Placeholder. The problem that manifests whenever I put any query string values into the link is that SSRS is duplicating them. When SharePoint receives this URL, this causes the New Item page to come up instead of displaying the list item.
Here is the expression where I'm building the link:
="http://home.oursharepointsite.net" & Left(First(Fields!Url.Value,"List"),InStrRev(First(Fields!Url.Value, "List"),"/")) & "DispForm.aspx?ID=" & Fields!ListItemId.Value
And here is the resulting link:
http://home.oursharepointsite.net/communities/home/Sites/CORPFI/Wiki1/Forms/DispForm.aspx?ID=395&ID=395
Another developer I work with isn't using the Action of a Placeholder but rather just building <a> tags and gets the same behavior. In his case it doesn't affect the rendering of what he's linking to though.
Does anyone know a way to solve this conundrum?
I recently had this problem and was able to solve it by making the link relative instead of absolute.
Try dropping the "http://home.oursharepointsite.net" and replace it with "/".

Sharepoint Custom List with custom new forms not able to add to folders

I have a custom list which has customized edit and new forms which were required by the user.
I then tried to add a new item to a folder (folders have the text of the year e.g. 2010) and when I click save on the customized new form it saves correctly but always to the root of the list.
I am wondering if there is a fix or a work around for this as it is highly annoying.
Alternatively can anyone recommend a way to implement a field which will auto calculate + 1 year from creation date, which might be a possible alternative however it will have to take into account the following.
Where the current year runs october to september.
Thanks for any help this has been driving me mad trying to find a solution.
Can't help much without knowing what you based the custom form on, but for a new form the folder to save to usually shows up in the query string.
The form is a basic custom form list which I have then just modified parts to remove fields that are not required or need to be read only.
The original form worked perfectly and allowed items to be added to the list subfolders.
The new one has no additional code and is using the standard sharepoint DataFormWebPart to create the custom list form and so I have no back end code to insert the item etc, although I may have to resort to this...will I?
You need to be careful when modifying standard forms. I recommend you go back to a copy of the standard form and verify that that saves correctly. Remove the "unneeded" fields until it stops working.
Sometimes with this sort of customisation you need to use css rather than server side changes to modify the form so that the functionality remains in place after the component is hidden.
It is definitely not an issue with the removal of fields as I created a new copy of the original and then changed it to a custom field saved it and tried to add an item.
It went straight into the root.
I tried the original form and it saves to the sub folder correctly.
Okay only work around I have for this at moment (I am currently in discussion with MS) is this.
http://blogs.msdn.com/sharepointdesigner/archive/2007/06/13/using-javascript-to-manipulate-a-list-form-field.aspx
I used the method getTagFromIdentifierAndTitle(tagName, identifier, title)
This returned the element I was after and then I basically went to the row dom node and deleted it.
I am hoping to have a nicer method but at least it is a work around for now.

Resources