Google form validate if submitted value matches list - regex

My two questions are:
Can I check if a submitted value matches entries in a list of accepted answers with Google Forms?
What kind of solution would you recommend?
Explanation of my goal:
I would like visitors to go on to the second page ONLY if their first answer matches one of the expected answers from a predefined list. (email list for example, or identification name)
Only those who would fill in the field with an expected email address would go on to the second page.
Unwanted visitors would then be given an error message.
I was thinking of the regexp solution at first, but there is probably a much easier and better solution.
Thank you for your time and clues.

I managed to solve my problem, so here's is the solution for those who will try and do something similar.
Answer found here:
Google Forms : REGEX
So it's answer type SHORT ANSWER
-> advanced settings
REGEX -> MATCHES -> mail2#mail1.com|mail2#mail2.com|mail3#mail3.com
For a limited list of email addresses, this wors just fine :)
P.S.: Thank you James anyway!! I appreciated even your interest in this question, so thank you.

Related

How to exclude retweets and replies from Twitter API Full-archive search

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

set multiple Strings for the same index

I am new to Kotlin language, and I want to make a login/register app simple for training. I have a problem when I want to store the username and password inside a list but both in the same index for the same account. For example:
var login = mutableListOf<String?>({"username1","password1"} , {"username2","password2"})
I tried searching for a way to do this but i did not found an answer. Sorry if it is the wrong section as it's my first time on this forum, thank you in advance.
Your example looks more like a map, so consider using a map like
mapOf("username1" to "password1" , "username2" to "password2").
But if you definitely need list of lists then maybe
listOf(listOf("username1", "password1"), listOf("username2", "password2"))
is what you are looking for.
There is also a nice facility in Kt - Pair
listOf(Pair("username1", "password1"), Pair("username2", "password2"))

REGEX in GA view filter (search and replace) to output a numeric ID from URI

I'd like to search and replace in Google Analytics view filter all my Request URIs in such a way that just the article id remains (plus, to add an "a-" before the ID).
Example URIs:
/raksts/sievietem/281750-ilona-balode-par-dzivi-ar-udriti-no-mums-beg-ka-no-grimstosa-kuga
/raksts/zinas/281427-video-izskatas-ka-spelu-automatu-atkariba-baibu-strautmani-nelaiz-vala
/raksts/arzemes/282070-pasauli-savilno-mazas-princeses-sarlotes-emocijas-karaliskajas-kazas
/raksts/izklaide/280379-turpinas-tirisana-jrt-maru-kimeli-atlaiz-hermana-sieva-aiziet-pati
The result I'm after:
a-281750
a-281427
a-282070
a-280379
In Regex checking sites it works like a charm, Regex being:
\/raksts\/\D+(\d+).+
Substitution being:
a-$1
But when I apply them to a GA filter, the checker tells me that the filter wouldn't have changed any data.
Not sure if I need to do this in GA - Data Studio would do too, the endgame being exported article IDs for our IT guys to implement in our editorial interface through Google API.
Probably a dumb question for which I apologize, but I feel quite stuck, so even a hint in the right direction will be greatly appreciated.
Try to add backslash before 1:
a-\1

Google Analtyics search and replace filter URI with Regex with an exception

Currently our registration form tracks UTM and SEM codes, plus you get very long string with Social sign ins. I end up with roughly 4k enrollment variations, very hard to track outside of goals.
In order to better trouble shoot channels, I've created a separate view where I want to combine everything into just /enrollment while excluding thank you page. So i would have a list like this:
www.mysite/enrollment
www.mysite/enrollment/
www.mysite/enrollment/sem01
www.mysite/enrollment/sem02
www.mysite/enrollment?adsforefacebook
www.mysite/enrollment?utmforemail
www.mysite/enrollment/thank-you
I've tried using this filter which works in the goal section, but I can't get it to work under filters.
Find
www\.mysite\.com\/enrollment(?!/thank\-you)
Replace
www.mysite.com/enrollment
Theoretically, this should catch everything with enrollment except thank you pages and replace with the new string.
I've tried several variations that include .*, but no go.
Oops. Nevermind, I think I figured it out right after I posted this. I don't think the normal find and replace works with exclusion patters and you have to use the Advanced filter... which worked exactly as expected with the above code.

How to get Facebook Page ID from Page URL

I need to get the Page ID from the Page URL. This is NOT from inside a page tab, that's easy. This is similar to what is being done here: http://findmyfbid.com
Any help would be appreciated as I have been searching for over an hour! Bonus points for showing how to do this in classic ASP. I have no issue getting signed requests & parsing them, the URL to ID portion is what is throwing me.
thanks :)
As noted above in 1st answer commments, that does work, but it's not the data that we want since it's an external url. THIS is the correct way to do it:
https://graph.facebook.com/v2.5/cocacola?access_token=[yourtoken]
OR
This works too:
https://graph.facebook.com/v2.5/https://www.facebook.com/cocacola?access_token=[yourtoken]
This is the way to do it: https://developers.facebook.com/docs/graph-api/reference/v2.0/url
if you are using a GET request, be sure to append access_token=appid|appsecret to the URL you are requesting and it will work.
Thanks for the tip to point me in the correct direction Alex!