asana API: how to create subtask - asana

How to create sub-task so that it added below the task with colon mark.
{u'id': 1637024742767L, u'name': u'Leads:'}, {u'id': 1644081849544L, u'name': u'new order'} .

Currently this is not possible with the API. Please see: Change priority headings for a task with the api
The answer from an Asana employee says that adding tasks relative to priority headings is not currently possible via the API.

Related

Filter Text Data

I am using Supermetrics to pull Facebook Ad Set Targeting data. But within the massive block of text that is generated, I need to filter it down to just the Excluded Custom Audience text.
This is one example of the Ad Set Targeting text:
{"age_max":65,"age_min":18,"app_install_state":"not_installed","**excluded_custom_audiences":[{"id":"6054936712957","name":"ios devices"},{"id":"6054936847157","name":"android devices"},{"id":"6131431891357","name":"People who used your app: OfferUp"},{"id":"6247466972157","name":"Exclusions.Android"},{"id":"6247467469757","name":"Exclusions.iOS"}]**,"geo_locations":{"countries":["US"],"location_types":["home","recent"]},"locales":[24,6],"targeting_optimization":"expansion_all","user_device":["Android_Smartphone","Android_Tablet"],"user_os":["Android"],"brand_safety_content_filter_levels":["FACEBOOK_STANDARD","AN_STANDARD"]}.
And I need to extract just the bolded text. Geo_location does not consistently follow Excluded_custom_audiences, so that can't be used.
Try the following:
=RegexExtract(A1,"""excluded_custom_audiences"":.*?]")
It translates to: extract everything (from A1) starting from "excluded_custom_audiences": up to the next occurence of ].
try:
=ARRAYFORMULA(REGEXREPLACE(SPLIT(FLATTEN(SPLIT(REGEXEXTRACT(A1,
"""excluded_custom_audiences"":\[(.*?)\]"), ",")), ":"), "\{|\}|""", ))

How to copy row of data from 1 tab to another without overriding the data in Google Sheets

I am pulling some tickets from Jira to a sheet and then perform some calculations on each of the rows.
Separately, I am pulling any new tickets on another tab to see if any new tickets need calculation. So my current setup looks like this:
Tab1 "Calc" sheet
Issue 113, Description, Priority, Score
Issue 112, Description, Priority, Score
In the same sheet I have a separate tab to pull any new tickets from Jira
Tab2 "Pull" sheet
Issue 115, Description, Priority
Issue 114, Description, Priority
Issue 113, Description, Priority
Issue 112, Description, Priority
Now because I have two new tickets 114 & 115, I need to copy these rows over into Tab1, without overriding the existing data.
How can I do this?

Query only most recent value if duplicates exist

I work at a warehouse and I am developing an Inventory System. When products come in, it is because they are damaged. I have one person fill out a row in Google Sheets when the product arrives (Sheet1 in the workbook link below). I mainly need Barcode, Issue, and Date from this Sheet).
Next, a mechanic fixes the product and fills out a google form with his name and the barcode of the product; the responses are Form Responses 1 in the workbook link below.
I then pull the data for all the incoming products from Sheet1 to a new tab (Barcodes In/Out in the workbook link below), querying Barcode, Issue, and Date. I pull the data for all the outgoing product in another column in this tab, querying the Barcode from the Form Responses 1. Column E (Backlog) has a formula that only shows barcodes of products that have not been repaired (gone "out").
I pull the data for what is in my Back log (products still in warehouse needing repair) into another tab named Back Log. This was working perfectly until I realized products can come back to our warehouse (i.e. "123" can come in and get fixed and sent out again. "123" can come back again for more repairs.)
This poses a problem because Back Log now shows "123" twice with two different Issues.
I need Back Log to query "123" only and only with the most recent Issue.
This is a lot of info, but I tried to be as detailed as I could. Thank you for your help in advance!
Here is the link to my workbook
In G2 I entered
=ArrayFormula(iferror(vlookup(unique(Sheet1!B2:B), sort({Sheet1!B2:B, Sheet1!A2:F}, 7, 0), {2, 3, 4, 5, 6}, 0)))
UPDATE: Based on new info...
=query(ArrayFormula(iferror(vlookup(unique(Sheet1!B2:B), sort(filter({Sheet1!B2:B, Sheet1!A2:F}, not(regexmatch(Sheet1!B2:B&"", textjoin("|", 1, filter('Barcodes In/Out'!D2:D, isna(match('Barcodes In/Out'!D2:D, 'Barcodes In/Out'!E2:E, 0))))))), 7, 0), {2, 3, 4, 5, 6}, 0))), "where Col1 <>''")
See if that works for you?

Google sheets nested if statement workaround

Link to sheet:
I'm trying to make a scorecard and leaderboard for my golf team, and I need to calculate how many holes a person has finished. The nested if statement in cell J2
=if(G11, 18,
=if(G10, 17,
=if(G9, 16,
=if(G8, 15,
=if(G7, 14,
=if(G6, 13,
=if(G5, 12,
=if(G4, 11,
=if(G3, 10,
=if(C11, 9,
=if(C10, 8,
=if(C9, 7,
=if(C8, 6,
=if(C7, 5,
=if(C6, 4,
=if(C5, 3,
=if(C4, 2,
=if(C3, 1, 0))))))))))))))))))
should accomplish what I need but there are too many functions in the cell to work.
The current function checks the cell where the 18th hole score should be, and if it's there, the player is through 18 holes. If not, it goes to the first nested if and checks the 17th hole score cell, etc...
I know I could do part the function in three different cells and it would work fine, but I'm curious if anyone has any better ideas.
Thanks!
I need to calculate how many holes a person has finished.
I believe what you need is the COUNT function.
=COUNT({G3:G11;C3:C11})
This will give the total number of holes a person has finished.
Below returns an array of all the hole numbers in the first set that has a value against it
=ArrayFormula(E3:E11*(G3:G11<>""))
Below returns the maximum of the hole numbers among all the holes that have a value against them.
=MAX(ArrayFormula(E3:E11*(G3:G11<>"")),ArrayFormula(A3:A11*(C3:C11<>"")))
Broke it up for brevity, but the second one is what I guess you need.

Using =IMPORTXML in Google Spreadsheets to extract a table by descriptions

From the website http://www.findagrave.com/cgi-bin/fg.cgi?page=gr&GScid=97961&GRid=22682396 I am trying to extract just the text data such as, birth, death, bio, location, and the created by sections into different rows/columns. I want to be able to have a spreadsheet where I can input a FindAGrave URL and have it extract the above data for me. I read here Using =importXML in Google Docs that its possible to do it by descriptions. From there I learned to omit the Xpath tbody. That successfully got my import to work, but without using the descriptions. I'm sure if using descriptions would be more efficient or not. I just want to learn how other people would go about importing data from tables.
Thanks
Here is what I got so far. This will extract the Birth information and put in rows. One problem is that it adds an extra cell in between each data.
=IMPORTXML("http://www.findagrave.com/cgi-bin/fg.cgi?page=gr&GScid=97961&GRid=22682396", "//html/body/table/tr/td[3]/table/tr[4]/td[1]/table/tr/td/table/tr/td/table/tr[1]/td[2]")
Result
Dec. 2, 1882 Humphreys County Tennessee, USA
Update: I think I made some process along in the code. This is what I'm working with now.
=IMPORTXML("http://www.findagrave.com/cgi-bin/fg.cgi?page=gr&GScid=97961&GRid=22682396", "//*[#class='gr'][1]//tr/td/table/tr/td/table/tr[1]/td[1]")
=IMPORTXML("http://www.findagrave.com/cgi-bin/fg.cgi?page=gr&GScid=97961&GRid=22682396", "//*[#class='gr']//tr/td/table/tr/td/table/tr[1]/td[2]/text()[1]")
=IMPORTXML("http://www.findagrave.com/cgi-bin/fg.cgi?page=gr&GScid=97961&GRid=22682396", "//*[#class='gr']//tr/td/table/tr/td/table/tr[1]/td[2]/text()[2]")
=IMPORTXML("http://www.findagrave.com/cgi-bin/fg.cgi?page=gr&GScid=97961&GRid=22682396", "//*[#class='gr']//tr/td/table/tr/td/table/tr[1]/td[2]/text()[3]")
=IMPORTXML("http://www.findagrave.com/cgi-bin/fg.cgi?page=gr&GScid=97961&GRid=22682396", "//*[#class='gr']//tr/td/table/tr/td/table/tr[1]/td[2]/text()[4]")
=IMPORTXML("http://www.findagrave.com/cgi-bin/fg.cgi?page=gr&GScid=97961&GRid=22682396", "//*[#class='gr'][1]//tr/td/table/tr/td/table/tr[2]/td[1]")
=IMPORTXML("http://www.findagrave.com/cgi-bin/fg.cgi?page=gr&GScid=97961&GRid=22682396", "//*[#class='gr']//tr/td/table/tr/td/table/tr[2]/td[2]/text()[1]")
=IMPORTXML("http://www.findagrave.com/cgi-bin/fg.cgi?page=gr&GScid=97961&GRid=22682396", "//*[#class='gr']//tr/td/table/tr/td/table/tr[2]/td[2]/text()[2]")
=IMPORTXML("http://www.findagrave.com/cgi-bin/fg.cgi?page=gr&GScid=97961&GRid=22682396", "//*[#class='gr']//tr/td/table/tr/td/table/tr[2]/td[2]/text()[3]")
=IMPORTXML("http://www.findagrave.com/cgi-bin/fg.cgi?page=gr&GScid=97961&GRid=22682396", "//*[#class='gr']//tr/td/table/tr/td/table/tr[2]/td[2]/text()[4]")
Results:
Birth:
Nov. 8, 1948
Benton
Saline County
Arkansas, USA
Death:
Jan. 6, 2006
Tulsa
Tulsa County
Oklahoma, USA
Is there a way to split this data up within the code?
The following formula
=IMPORTXML(
"http://www.findagrave.com/cgi-bin/fg.cgi?page=gr&GScid=97961&GRid=22682396",
"//html/body/table/tr/td[3]/table/tr[4]/td[1]/table/tr/td/table/tr/td/table/tr[position()<=2]/td/text()"
)
returns
Birth:
Nov. 8, 1948
Benton
Saline County
Arkansas, USA
Death:
Jan. 6, 2006
Tulsa
Tulsa County
Oklahoma, USA
A shorter alternative,
=IMPORTXML(
"http://www.findagrave.com/cgi-bin/fg.cgi?page=gr&GScid=97961&GRid=22682396",
"//tr[4]/td[1]//tr[position()<=2]/td/text()"
)
returns the same result
You can get multiple fields by simplifying your xpaths - you can also add multiple into one single function call separating the xpaths with a | :
`=ARRAYFORMULA(TRIM(TRANSPOSE(IMPORTXML($A3,"//td[#align='left']/text()|//tr[6]/td/a|//tr[3]/td/text()[1]"))))`
The three xpaths used are:
//td[#align='left']/text()
//tr[6]/td/a
//tr[3]/td/text()[1]

Resources