Extract the content of text to be used in a Zapier action - zapier

Can someone please help with a code that will extract a name from a text. I am trying to create an action in a Zapier that will extract the Firstname and Lastname from a gmail. I've tried to modify the "Simple Email Extraction" example given here https://zapier.com/help/code/#introductory-examples , but need someone to point me in the right direction. The example gmail will look like this:
Navn: Firstname Lastname
Adresse: Streetadress
PostNr/Sted: Postalcode City
E-post: emailadress
Mobil: mobilephone
What I need to extract is the content of "Firstname Lastname" into an output that can be used in the action.

the Zapier email parser suggested by Matt solved this problem.

Related

How to write xpath for below screenshot

I am new in appium. I want to find element for username and password displayed in screenshot. If i am using //class then value is same for both username and password. Please help. I want to know all methods to identify the elements(like using class, id, xpath) if possible.
Thanks in advance. Please find the screenshot below
enter image description here
Use this:
Username - driver.findElementByXPath("//*[#class='android.widget.EditText' and #index='0']");
Password - driver.findElementByXPath("//*[#class='android.widget.EditText' and #index='1']");

Retrieve Specific Value In Firebase

I have a list of users in Firebase that looks like this...
How would I retrieve only the email (for example) values?
THE answer.
Two things.
1) Please copy and paste your structure instead of a picture so we don't have to retype it. Please take a minute to format it so it looks cool.
2) This is a very basic query in Firebase and fully explained in the Most Excellent Guide to Retrieving Data In Firebase
Scroll down the query section and there are a couple of examples that are very similar to what you are asking for.
And a tad more info. Doing a query will retrieve each child node that matches the query (including the other stuff within the node). It's up to your code to grab each email (pretty simple task as it's key:value pairs)
If you don't want the other stuff, you would need to change the structure of the data
asdf
firstName
lastName
etc
emails
asdf
email: email address
asdf1
email: email address
or, use events: value for example and a structure like this
emails
asdf: email address
asdf1: email address

Handling order of names in languages like Chinese

In numerous places in my app, I have a name displayed (current user or other user). I have 3 fields for name: firstName, lastName and fullName. Full is simply firstName + lastName, and not used very often. I use 'firstName lastName' more often than fullName.
I recently localized the app into other languages, among them Chinese and Japanese, in which the order for names is reversed to 'lastName firstName'.
I am unsure how to handle this change now in my app. Has anyone encountered a similar challenge and how did you handle it?
Thank you
I figured out how to do this by saving a string called fullName in my Localizable Strings file as follows:
"fullName" = "%1$# %2$#";
Then, in the languages that have the name order different, their "fullName" string is like this:
"fullName" = "%2$# %1$#";
Hope this is helpful to someone else! :)

ransack searching each word in a text_field

I will searching with ransack in my Rails application for users by firstname and lastname. In one text_field for firstname and one text_field for lastname the application user should have the possibility to search for several parts of the name.
E.g. the user will enter "Thomas Jeffrey" and this should results in:
SELECT FROM users WHERE firstname LIKE "%Thomas%" AND firstname LIKE "%Jeffrey%";
If I use firstname_cont the result looks like:
SELECT FROM users WHERE firstname LIKE "%Thomas Jeffrey%";
When I was trying firstname_cont_all out, I got something different.
Thank you for any hint.
User.search(firstname_cont_all: params[:my_field].split)
I do not know, however, how to properly introduce that splitting to array when using ransack's condition_field form builder utility.

g:countrySelect with full country name as value

I want to store the exact country name using g:countrySelect. Example Germany instead of DEU. It is the value in the drop down menu. The drop down text is Germany but when it saves it to the database it changes back to the country code. Sorry if I am somewhat naive but I have been searching for almost 3 hours for solutions and it isn't well documented at the grails website. I could opt for any alternative even ajax. Just to have an easy way to display a list of countries and will be able to store the REAL NAME of the country NOT country code. Thank you!
You can convert from an ISO3 country code to the country name using this function
def getCountryName(String countryCode) {
Locale.availableLocales.find{it.ISO3Country == countryCode}.displayCountry
}
// Test
println getCountryName('DEU') // prints 'Germany'
If you want to do this within a GSP, it would be best to make this available as a TagLib.
Not sure when the above solution stopped working but if you try that now, you'll get an error:
Couldn't find 3-letter country code for CS
With the latest grail version, the current way of getting the full country name is by using this tag:
<g:country code="${country}"/>
I know this thread is old, but I was looking for the same issue and I had to share my solution.
You can use the CountryTagLib object to convert the ISO3 code back to full country name like this :
def country = CountryTagLib.ISO3166_3[code]
The "code" property being the ISO3 code that you got from <g:countrySelect>.

Resources