Need clarification on creating Tasks in Asana - asana-api

The documentation for tasks seems to imply that the POST method uses name/value pairs as the data payload (I'm assuming for a content type of application/x-www-form-urlencoded). Can it accept JSON instead, using the same format as the data returned from a GET call for tasks?
Also, the Memberships field is supposed to contain an array of projects and sections. There's already a Projects field for a task - do those projects need to be duplicated in the list of projects for Memberships or can just the sections be included?

Yep, it's totally possible to use a JSON payload (with the correct Content-Type: application/json) - in fact, in a number of scenarios - like this one - it's considerably easier.
I don't recall off of the top of my head the right way to get this going with form data (if I recall, we might have an outstanding bug filed about it :) ), but with JSON, you should be fine if you specify the project in both locations. I don't think you can get away with not specifying any values in projects (unless you specify a workspace, which might work).
I don't think you can specify only the section. Finally, I think if you specify a different project in each location, it will put it into both: into projects in the "no section" area for whichever ones are in the projects property and put it in the specified sections for those specified in memberships

Related

KQL (Keyword not Kusto) Nesting, Document Selecting for an Extranet

Longtime member, been a while since posting. Working on building out an Extranet and am running into a stupidly frustrating issue. First time using SharePoint Online as document repository for external (anonymous) users. In doing so, using Azure permissoning, have the documents split up in repositories on SharePoint based on access level. On top of that I am attempting to display them in Highlighted Content Web part, I am not able to sort them out by location AND type. I have a custom column in each repository that defines what type they are, but when I try to add the AND portion to the KQL it doesn't work. Additionally the internet seems to be massively void of actual documentation of KQL.
(
path:https://domain.sharepoint.com/sites/example/Level%201%20Resources/
OR
path:https://domain.sharepoint.com/sites/example/Level%202%20Resources/
OR
path:https://domain.sharepoint.com/sites/example/Level%203%20Resources/
OR
path:https://domain.sharepoint.com/sites/example/Level%204%20Resources/
OR
path:https://domain.sharepoint.com/sites/example/Level%205%20Resources/
OR
path:https://domain.sharepoint.com/sites/example/Level%206%20Resources/
AND
DocType:"Articles"
)
The above will simply pull all documents from those locations and ignore the AND statement. I have tried renaming it to call on the custom column identifier pulled from the source, and that doesn't work either.
The only real documentation I can find on this is: Here
Which doesn't appear to address filtering based on custom column tags.
EDIT: Reformatted to pull all docs from multiple locations using below, but the nesting portion still isn't working
path:(
"https://domain.sharepoint.com/sites/example/Level%201%20Resources/"
OR
"https://domain.sharepoint.com/sites/example/Level%202%20Resources/"
OR
"https://domain.sharepoint.com/sites/example/Level%203%20Resources/"
OR
"https://domain.sharepoint.com/sites/example/Level%204%20Resources/"
OR
"https://domain.sharepoint.com/sites/example/Level%205%20Resources/"
OR
"https://domain.sharepoint.com/sites/example/Level%206%20Resources/"
)
So the additional issue I was running into was the creation of a column to separate out based on the category of file type (not literal file type). Apparently SPO doesn't like it when you create a list and then reference that list to then filter by via KQL. So I found this morning this.
Apparently the best way to do this is create a custom "Choice" column, allow some time for it to flow and update, and then you can reference it via KQL.

Kentico - WHERE condition for custom Page Types page

I have a custom page type for employees, and one of the fields is Location. I want to show/filter only employees in "San Jose" or "San Francisco" and used this WHERE condition below but it didn't work. Apparently, I missed something very basic. Could you help?
Location LIKE '%San%';
I did another test, where instead of page type, I used custom table with the exact field names and was able to filter using the same statement. On a related note, I'm new to Kentico and exploring which is more suitable for creating/maintaining a list of about 100 employees - Page Types or Custom Tables - with the ability to filter by department, location etc. Appreciated your input here as well. Best!
If you're adding the WHERE condition into a standard Kentico repeater or other data source, the syntax looks right except you do not need the semicolon ";".
You'll also want to double check the field name, and if you are limiting your query to certain columns (as is best practice especially for larger data sets) and be sure the field you are filtering on is being selected.
Regarding the management of your employee list, either method you've described will work. In that scenario it typically depends on who will be editing the content, and how frequently. It is more editor-friendly, in my opinion, to add those documents into the content tree. This also gives you quicker control over the order, and keeps it similar to how other content on the site is maintained. I also like to set up folders or other parent page types as categories if needed, so the documents can be dragged and dropped between them and it sets up a visual taxonomy that isn't possible if it's all stored in a table. Storing items in the tree also allows for workflow and versioning, as well as more granular control over permissions/access, if this is important to you.
It's awesome that you are thinking about how to best store your data in advance. There many factors to consider such as overall number of records, number of columns, the fact whether you need to use workflow, versioning, preview etc..
The best source of information regarding this would be this article which summarizes all options you have and gives clear explanations of which to use in which scenario.
And to your original question - What components are you using to display the data? Is the repeater? If so, can you make sure to set the Page types property to match the page type you are displaying? If the page types is not configured, Kentico will not load any custom fields because it doesn't know from which table it should load the data from.
Additionally make sure to either include the "Location" field in the Columns property or leave the columns blank (not recommended because then Kentico loads all columns which is like 200. when you count all from CMS_Document, CMS_Tree etc..)
Below is the framework that I use to debug whenever I wish to add a repeater and is facing some problem.
First get all the columns instead of accessing limited columns. Fetching all columns will make sure that I don't have any problem retrieving data.
If I am missing any particular column information name, then I would double check the column name.
I verify this by firing up SQL server management studio and access data from page type table or custom table.
If access to SQL server is not available(generally in Azure hosted solutions with restrictive access to DB), I would enable SQL debug from the settings and see what query repeater is generating to see if it is correct.

How safe is it to rely on Sharepoint "ct100" identifiers?

There are various places in my Sharepoint generated web pages where element IDs are assigned values by Sharepoint with the prefix "ct100".
How safe is it to refer to these IDs in my javascript?
How static are they?
How likely are they to change for any reason?
Is there any documentation that discusses how they are generetad and answers the above questions?
Thanks,
George
"Safe" is relative here and depends on the specific page and controls involved.
The individual IDs that look like ctXYZ are generated automatically by the parent ASP.Net Naming Container when the control has not been explicitly assigned an ID - that is, the ID is auto-generated like ct001, ct002, etc, making sure not to create duplicates.
The final Client ID - which is assigned as the id attribute in the HTML - is the made up of joining all the IDs of the control and all ancestors with underscores; thus the stability of a single Client ID is affected by multiple controls.
The generated Client IDs are generally guaranteed to remain stable only if the Control Tree is always re-created in the same way - this holds true in many cases, but it is not absolute. Dynamically adding or removing controls can easily break this assumption.
ASP.Net 4 (or 4.5?) introduced a different ID mode - primarily "Predictable", see the Naming Container link - but I do not believe that SharePoint uses this new feature anywhere; and it's definitely not used for IDs that contain ctXYZ components.
Based on research, the safest approach is to use css and jquery to identify and manipulate the "ct001" elements. I have tried this approach and it appears to be working fine.

Sharepoint WSS 3.0 Attributes returned from GetListItems

Is there some definition around the attributes that are returned from the Lists.GetListItems? I am able to view the attributes retuned just fine but I am wondering if they would ever change?
Here are some examples of what I am seeing... #ows_Author, #ows_FileDirRef, #ows_PermMask
I would like to build some classes around these values and my concern is that if they are not published somewhere Microsoft may up and change them or some setting in Sharepoint may.
It is possible that they change as sharepoint (major) version changes. Every change is possible then.
Don't think it would happen in minor version.
However they may also change depending on what list you query. But fields your mentioned and many other fields are basic fields that every list will contain.
If you want to view field data yourself (for example, what Type they are), download Sharepoint Manager - it's invaluable tool for a developer.
These are internal field names for default SharePoint fields. Unless you explicitly change them, they will remain the same.
Micheal Yeager's blog has a table which describes these fields and their data types:
http://blogs.msdn.com/michael_yeager/archive/2008/11/03/reference-list-for-internal-field-names.aspx

Drupal6: How to handle node links in user profile attributes?

One of the fields in my user profiles is a list of nodes. (This list is generated automatically, based on other data on the site.) Currently, it displays like this:
Nodes
nid1, nid2, nid3
I want it to look like this:
Nodes
$nid1->title, $nid2->title, $nid3->title
where each title is a link to its node. What is the best way to do this? I tried filling the field with links generated by l(), but the html gets filtered out.
Also, when using l(), is there a way to say: create a link to the node with $nid, no matter where it happens to be located at runtime?
Concerning the first question:
The field values of a profile list are run through ´check_plain()inprofile_view_field()`, so you can only get markup in there after they got loaded, which leaves you with at least two options, depending on where you want to alter the output:
Implement hook_user() and, on the 'view' operation, modify the field values in the $account->content array (Make sure that your modules weight is below that of the profile module or the values will not be in there yet).
Add your own preprocess functions for all templates where the fields are used and make your adjustments there. On first sight, these should be the following, but the list might be incomplete:
yourModule_preprocess_profile_block() (profile module)
yourModule_preprocess_profile_listing() (profile module)
yourModule_preprocess_user_profile_item() (user module)
As for the second question:
Also, when using l(), is there a way
to say: create a link to the node with
$nid, no matter where it happens to be
located at runtime?
I do not understand what you mean by "no matter where it happens to be located at runtime". Anything that is not covered by the following?
l('SomeTitle', 'node/' . $nid)

Resources