I need to filter a SharePoint list with a REST webservice with a NOT contains operation.
There is a text field called "Inactive" containing a string. I would like to filter the list to show all items in which the field "Inactive" does NOT contain a certain string.
I already tried several way to do this, but none of them was successfull.
$filter=not substringof('R01', Inactive)
$filter=(not%20substringof('R01', Inactive))
$filter=substringof('R01', Inactive) ne true
The positive query $filter=substringof('R01', Inactive) works fine.
I already searched for hours but couldn't find a solution.
Has someone solved this issue and could help me?
Best regards,
Remo
I just found out while trying some more possibilities that $filter=(not substringof('R01',Inactive)) works on SP 2013 and also on SP2010.
It seems that I somehow made some typing errors before.
Related
I don't have a lot of experience in Django and I am a fairly green developer. When I run the localhost I keep getting a Internal Error. I have tried most of the solutions to similar problems here and none of them works. Can anyone help me? The code is not mine so I don't want to alter it as such either.
Here is a picture of the errors I keep getting:
The only thing you can do without altering the code is to enter the value "shop_all_art" in the HomePage table in the database.
Do not share code via images. You should also share the related code.
Your stacktrace clearly says, that Python is not able to access first element of HomePage.objects.filter(value='shop_all_art') in file bidgala/bidgala/pages/views.py. all_art_img is most probably empty.
Looks like all_art_img is empty.
you should check if a Query has any elements before with a method such as
if all_art_img.exists():
all_art_img[0]
I am trying to extract some historical tweets using twitter API. And I want to exclude retweets and replies. I tried other suggested answers here but nothing seem to work. Can someone please help me, I am struggling since a week to find the resources. Below is my endpoint for Full-archive search.
https://api.twitter.com/2/tweets/search/all?query=MMIW OR MMIP OR MMIWG&start_time=2015-01-01T00:00:01Z&end_time=2015-01-15T23:59:01Z&max_results=500&tweet.fields=created_at,entities,geo,id,referenced_tweets,in_reply_to_user_id,lang,possibly_sensitive,source,text,withheld&place.fields=country,full_name&user.fields=created_at,description,location,name,pinned_tweet_id,username,verified,withheld
Okay, so I figured out from twitter's rules and filtering operators from the link below:
https://developer.twitter.com/en/docs/twitter-api/enterprise/rules-and-filtering/operators-by-product
i just had to add and negate the is:retweet operaor in my query field.
Ex: query=(MMIW OR MMIP OR MMIWG) -is:retweet
So, my modified endpoint that worked:
https://api.twitter.com/2/tweets/search/all?start_time=2015-01-01T00:00:01Z&end_time=2015-01-15T23:59:59Z&max_results=500&tweet.fields=created_at,entities,geo,id,lang,possibly_sensitive,source,text,withheld,in_reply_to_user_id,referenced_tweets&place.fields=country,country_code,full_name,geo,id,name&query=(MMIW OR MMIP OR MMIWG) -is:retweet&user.fields=created_at,description,location,name,pinned_tweet_id,username,verified
I am trying to save an array of text containing category types for a hotel system which looks something like this ['category-1', category-2', category-3, category-4] . I am using category_type = ArrayField(models.CharField(max_length=200),null=True) in my models.py
The error i get is
malformed array literal: "" LINE 1: ..., '{category-1,
category-2}'::varchar(200)[], ''::varcha...
^ DETAIL: Array value must start with "{" or dimension information.
The error persist even after processing python list from ['category-1', category-2', category-3, category-4] to {category-1, category-2, category-3, category-4}.
I have gone through postgresql documentation and have found very limited help,
https://pganalyze.com/docs/log-insights/app-errors/U114 this is something similar posted to what i am facing problem with.
Could someone please tell me what am i doing wrong? Any help would be appreciated.
EDIT:
Following is in my View.py
hotel_category=categoryTable(category_type=categorytype)
hotel_category.save()
and i am using categorytype=request.POST.getlist('category-type') in my Views.py to get it from the POST request after user submits the form. This returns a Python list that i have mentioned above, i have manipulated this list to match PostgreSQL ArrayField with '{','}' but i still have this error. If there is anything else you would like me to add, please let me know. :)
This is an update/answer to my question for anyone who faces this issue in the future. After struggling to find help from different resources, i decided to use JSON string to store my python list.
I am using :
categorytype = json.dumps(request.POST.getlist('category-type'))
to encode and using JSONDecoder() to fetch from database and decode. I have no idea how would this impact my further development but for now it seems a decent approach since personally i think ArrayFields are not well supported and documented in Django.
I will keep this post updated as i progress further on how this approach has impacted my development.
Have a nice day.
I just started to use WebRatio and I am facing a simple problem, with easy solution if I was not using this fabulous framework .... I was asked to do some sort of glosary app, and what I am trying to do right now is a simple index where appears all letters from A-Z and how many entries starting with each letter there are in my database, quite simple.
I aleady started a database with my entity: name, description and last_modified. I had been looking for some information on how to do this but I found nothing. So what I am trying to do is to fill a list with a custom query that I made (it works good on my sql editor) but I am not able to list the results in a WebRatio list. I tried to use a "query" object linked to a "simpleList" object but when I run the app it gives me error: "Expected at least one element .. inside " I would appreciate any help or resource that explains how to do this.
Thanks in advance
You shouldn't link the query unit with list because the list will make it's own database query. Instead you should specify outputs for query unit and write your custom style template for query unit to visualize the results as html. Or also (not recommended) you can link the results of query unit with a script unit and output desired html within a script unit.
If I got to calendar, click on To Do, then try to add an event, the form pops up, I fill it out, press save, but no Event gets added.
In the SQL error log's I see an error like this:
2011-09-29 14:57:07 EDT ERROR: null value in column "visibility" violates not-null constraint
2011-09-29 14:57:07 EDT STATEMENT: insert into
vtiger_activity(activityid,subject,date_start,time_start,time_end,due_date,status,eventstatus,priority,sendnotification,activitytype,visibility,duration_hours,duration_minutes,location,recurringtype,notime)
values('235','Testing','2011-09-29','19:50',NULL,'2011-09-29','Not Started',NULL,'High','0','Task',NULL,NULL,NULL,NULL,NULL,'0')
So, for some reason, it is trying to add a To-Do while inserting null values. My biggest problem is that I cannot locate the origin of the query. So, basically, the most important thing I am asking is what file takes the data that was input into the todosave form and turns it into a query.
I don't know if many people on here use Vtiger, but I couldn't figure this out so I went ahead and posted anyway. The official documentation is not very helpful in my opinion.
Thanks for everything, have a good day.
This might be an isolated case, but was any of the modules modified recently? In this case, I would assume that it would be the Calendar module. I've tested this on the demo website and on my vTiger installation and it works fine..
Perhaps you can download a fresh copy of vTiger and replace the modules/Calendar all its content.
By the way, another place to ask if you have any questions, is the vTiger forums.
http://forums.vtiger.com/index.php
Usually you can ask it in the Help - 5.2.1 section. Hope this helps!