Polymer Firebase Binding for Location - firebase

I've been trying to bind a location value to a "note" (as in the na-notes example in codelabs) via firebase. I'm using the paper-input-place, but have tried with several other elements to no avail. So far, this is what I have (corresponding to the na-note.html document):
<paper-input-place is="iron-input" bind-value="{{address}}" value="{{address}}" label="Address" api-key="key">
And then I have this on my na-editor.html:
<na-note id="note" title="{{note.title}}" location="{{note.place_id}}" price="{{note.price}}" rooms="{{note.rooms}}" beds="{{note.beds}}" baths="{{note.baths}}" editable></na-note>
I am thinking that it probably is a silly mistake, but I've been going at it for two days and I'm starting to loose my patience, so any help would be appreciated!
Thanks!

at above na-note element, note is an object retrieved from firebase. so, to this path, you will need to save location data of the note. So, when you received the proper data from paper-input-place element, you will need to save it to the note's path as a location. So, first retrive the address:
<paper-input-place hide-error place="{{place}}" api-key="[[apiKey]]" on-place-changed="searchPlaceChanged" > </paper-input-place>
...
searchPlaceChanged(p){
console.log(p.detail.value); // You will need to see the place data, which you may like to save only some detail like: p.detail.value.formatted_address;
this.set('note.place', p.detail.value.formatted_address);
}
Asuming just abobe note object (at set operation) is firebase-document's two way binding retrived data that you just editing.

Related

Logic App using HTTP Action to access and GET Jira ticket

So I followed this answer and it works fine:
https://stackoverflow.com/a/74981947/20829088
Provided URL:
https://<YOUR_DOMAIN>.atlassian.net/rest/api/2/search?jql=project=<PROJECTID>&fields=issue,status,name&startAt=0&maxResults=8000
However, it take a lot of time. So, if I want the url to check for specific ticket depending on created time and type of ticket. For example
I want ticket that is created within 15 days and that are NOT a sub-task.
so I tried something like this.
.....&fields=issue,summary,issuetype&created>=-15d&hierarchylevel=0
I'm not sure of how it should be written I just tried this and it doesn't work.
Here is the request result in JSON:
It should be earthier [subtask=false] OR [hierarchylevel=0] OR [name=Task]
After reproducing from my end, I could able to achieve this using Condition connector of logic apps. I have initialized an array variable first and then tried to append each item that satisfies the condition. Below is the flow of my logic app.
and then I used Parse Json to retrieve the required values for condition comparision
You can use the below Code view to reproduce the same in your environment.
{"definition":{"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#","actions":{"For_each":{"actions":{"Compose":{"inputs":"#items('For_each')?['fields']?['created']","runAfter":{},"type":"Compose"},"Condition":{"actions":{"Append_to_array_variable":{"inputs":{"name":"Array","value":"#items('For_each')"},"runAfter":{},"type":"AppendToArrayVariable"}},"expression":{"or":[{"greaterOrEquals":["#formatDateTime(outputs('Compose'),'yyyy-MM-dd')","#formatDateTime(addDays(utcNow(),-15),'yyyy-MM-dd')"]},{"equals":["#items('For_each')?['fields']?['issuetype']?['subtask']",false]},{"equals":["#items('For_each')?['fields']?['issuetype']?['hierarchyLevel']",0]},{"equals":["#items('For_each')?['fields']?['status']?['statusCategory']?['name']","Task"]}]},"runAfter":{"Compose":["Succeeded"]},"type":"If"}},"foreach":"#body('Parse_JSON')?['issues']","runAfter":{"Parse_JSON":["Succeeded"]},"type":"Foreach"},"HTTP":{"inputs":{"authentication":{"password":"<API_KEY>","type":"Basic","username":"<USERNAME>"},"method":"GET","uri":"https://jira#<ProjectName>.atlassian.net/rest/api/2/search?jql=project=<ProjectID>"},"runAfter":{},"type":"Http"},"Initialize_variable":{"inputs":{"variables":[{"name":"Array","type":"array"}]},"runAfter":{"HTTP":["Succeeded"]},"type":"InitializeVariable"},"Parse_JSON":{"inputs":{"content":"#body('HTTP')","schema":{"properties":{"expand":{"type":"string"},"issues":{"items":{"properties":{"expand":{"type":"string"},"fields":{"properties":{"aggregateprogress":{"properties":{"progress":{"type":"integer"},"total":{"type":"integer"}},"type":"object"},"aggregatetimeestimate":{},"aggregatetimeoriginalestimate":{},"aggregatetimespent":{},"assignee":{},"components":{"type":"array"},"created":{"type":"string"},"creator":{"properties":{"accountId":{"type":"string"},"accountType":{"type":"string"},"active":{"type":"boolean"},"avatarUrls":{"properties":{"16x16":{"type":"string"},"24x24":{"type":"string"},"32x32":{"type":"string"},"48x48":{"type":"string"}},"type":"object"},"displayName":{"type":"string"},"emailAddress":{"type":"string"},"self":{"type":"string"},"timeZone":{"type":"string"}},"type":"object"},"customfield_10001":{},"customfield_10002":{},"customfield_10003":{},"customfield_10004":{},"customfield_10005":{},"customfield_10006":{},"customfield_10007":{},"customfield_10008":{},"customfield_10009":{},"customfield_10010":{},"customfield_10014":{},"customfield_10015":{},"customfield_10016":{},"customfield_10017":{"type":"string"},"customfield_10018":{"properties":{"hasEpicLinkFieldDependency":{"type":"boolean"},"nonEditableReason":{"properties":{"message":{"type":"string"},"reason":{"type":"string"}},"type":"object"},"showField":{"type":"boolean"}},"type":"object"},"customfield_10019":{"type":"string"},"customfield_10020":{},"customfield_10021":{},"customfield_10022":{},"customfield_10023":{},"customfield_10024":{},"customfield_10025":{},"customfield_10026":{},"customfield_10027":{},"customfield_10028":{},"customfield_10029":{},"customfield_10030":{},"customfield_10033":{},"description":{},"duedate":{},"environment":{},"fixVersions":{"type":"array"},"issuelinks":{"type":"array"},"issuetype":{"properties":{"avatarId":{"type":"integer"},"description":{"type":"string"},"entityId":{"type":"string"},"hierarchyLevel":{"type":"integer"},"iconUrl":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"self":{"type":"string"},"subtask":{"type":"boolean"}},"type":"object"},"labels":{"type":"array"},"lastViewed":{},"priority":{"properties":{"iconUrl":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"self":{"type":"string"}},"type":"object"},"progress":{"properties":{"progress":{"type":"integer"},"total":{"type":"integer"}},"type":"object"},"project":{"properties":{"avatarUrls":{"properties":{"16x16":{"type":"string"},"24x24":{"type":"string"},"32x32":{"type":"string"},"48x48":{"type":"string"}},"type":"object"},"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"projectTypeKey":{"type":"string"},"self":{"type":"string"},"simplified":{"type":"boolean"}},"type":"object"},"reporter":{"properties":{"accountId":{"type":"string"},"accountType":{"type":"string"},"active":{"type":"boolean"},"avatarUrls":{"properties":{"16x16":{"type":"string"},"24x24":{"type":"string"},"32x32":{"type":"string"},"48x48":{"type":"string"}},"type":"object"},"displayName":{"type":"string"},"emailAddress":{"type":"string"},"self":{"type":"string"},"timeZone":{"type":"string"}},"type":"object"},"resolution":{},"resolutiondate":{},"security":{},"status":{"properties":{"description":{"type":"string"},"iconUrl":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"self":{"type":"string"},"statusCategory":{"properties":{"colorName":{"type":"string"},"id":{"type":"integer"},"key":{"type":"string"},"name":{"type":"string"},"self":{"type":"string"}},"type":"object"}},"type":"object"},"statuscategorychangedate":{"type":"string"},"subtasks":{"type":"array"},"summary":{"type":"string"},"timeestimate":{},"timeoriginalestimate":{},"timespent":{},"updated":{"type":"string"},"versions":{"type":"array"},"votes":{"properties":{"hasVoted":{"type":"boolean"},"self":{"type":"string"},"votes":{"type":"integer"}},"type":"object"},"watches":{"properties":{"isWatching":{"type":"boolean"},"self":{"type":"string"},"watchCount":{"type":"integer"}},"type":"object"},"workratio":{"type":"integer"}},"type":"object"},"id":{"type":"string"},"key":{"type":"string"},"self":{"type":"string"}},"required":["expand","id","self","key","fields"],"type":"object"},"type":"array"},"maxResults":{"type":"integer"},"startAt":{"type":"integer"},"total":{"type":"integer"}},"type":"object"}},"runAfter":{"Initialize_variable":["Succeeded"]},"type":"ParseJson"}},"contentVersion":"1.0.0.0","outputs":{},"parameters":{},"triggers":{"manual":{"inputs":{"schema":{}},"kind":"Http","type":"Request"}}},"parameters":{}}

Q - Postman: How to clear collectionvariables between tests

I'm new to API testing through postman and i'm currently trying to figure out how to clear down my collection variables between automated tests.
Here is my code below - Thanks so much for anybody who can point me in the right direction.
Warning :
pm.collectionVariables.clear()
will delete all your collection variables:
pm.collectionVariables.unset("variablename")
will delete that particular variable.
so if you just want to reset the value to initial value then:
in the first request add:
pm.environment.get("resetValue") ? null:pm.variables.set("resetValue",pm.collectionVariables.toJSON().values)
Here we store data only if resetValue variable is not set
And in the last request:
pm.environment.get("resetValue").forEach((a)=>pm.collectionVariables.set(a.key,a.value))
pm.environment.unset("resetValue")
This make sure you don't set resetValue incorrectly if you are running first request multiple time
you can also use pm.variables if you don't any variable to be affected , thats the better way

Cannot create Temperature Data Source?

I'm trying to create the temperature data source via REST and it keeps on failing with:
Data type does not match well-known data type with the same name
The data I'm sending in is:
{"application":{...Same as other working samples....},"dataType":{"field":[{"name":"body_temperature","format":"floatPoint"},{"name":"measurement_location","format":"integer","optional":true}],"name":"com.google.body.temperature"},"name":"Temperature Feed","type":"raw","dataStreamId":"raw:com.google.body.temperature:XXX"}
Per https://developers.google.com/fit/datatypes/health#body_temperature , I am not seeing any reason this shouldn't work -- what am I doing wrong? Does temperature require special permission?
Thanks.
Eric
The issue is that measurement_location must be body_temperature_measurement_location in the REST request. After changing that, it now works.

Can't Edit/Update Certain Items In Database (Table)

I have database that I have multiple orders entered into. Everything seems to be working fine except for a few old entries which will not accept updates/changes to their Fields.
Note: The majority of the Fields are Strings with Possible Values entered via a DropDown Box.
So if I open Order A I can make adjustments just fine and those changes persist even after closing the page and coming back or refreshing.
But if I open Order B, I can make changes via the dropdowns and it looks like they have adjusted, however if I leave the page or refresh all the changes have reverted back.
One piece of info that may be helpful is that each of these orders has at least one Field that contains an entry that is no longer a Possible Value (the original entries were removed/changed per request of the client).
Maybe they are "locked" because of this? Is there a way to look at an error log for a Published app?
I can delete the "corrupt" entries and recreate them (since there are currently only a few), but I would prefer to find a better solution in case this happens again in the future.
Any help would be greatly appreciated.
It's a bug. Such field level value updates should get through.
As workaround you can update prohibited(not possible anymore) values with allowed ones in OnSave Model's Event like:
switch (record.Field) {
case "old_value_1":
record.Field = "new_value_1";
break;
case "old_value_2":
record.Field = "new_value_2";
break;
...
}
Sorry for the inconvenience.
Each deployment has its own log. Have you tried "App Settings > DEPLOYMENTS > (click on the desployment) > VIEW LOGS"?

Biztalk Preload output message before Map transform

I have 2 correlated incoming messages from 2 different systems (SystemA and SystemB) and I just want to basically copy over a couple fields from the SystemA message to the SystemBmessage.
So my Construct Message shape looks like this:
The Message Assignment shape just has this code inside it:
xmlIncomingNoAttachHolder = new System.Xml.XmlDocument();
xmlIncomingNoAttachHolder = msgMultiPartInNoAttachment.BodySegments;
// assigning the SsytemB version (no attachment) first.
// Also, since we are only copying a couple fields, this can serve as the base.
msgComboWithAttach = xmlIncomingNoAttachHolder;
msgComboWithAttach(XMLNORM.TargetCharset) = "UTF-8";
The map then just has the 2 input (SystemA schema and SystemB schema) ORU messages on left and the output ORU message on the right, which also shares the same schema as the SystemB input message.
My hope was that I could just use the message assignment code above to assign the Output msgComboWithAttach message, then use the mapper to map over the few fields that we need from the SystemA message to the SystemB message.
But it seems that as soon as I apply the map, it clears the pre-loaded msgComboWithAttach message before performing the transform and then applies the map. The resulting message then contains ONLY those fields that are copied over in the map and none of the other segments/fields that were assigned in the message assignment pre-load.
Is this expected behaviour, in which case, I would have to do a Mass-Copy on all the segments in the Map? Or is there a way to pre-load/copy the message like I want and then only Map a couple fields over?
Yes, that is the expected behavior since the transform will create a new message. You cannot use Xslt to modify a document in that way.
Dijkgraaf's solution will work. As an alternative, you can use the Orchestration xpath() function to read and set specific values in Message. See: http://msdn.microsoft.com/en-us/library/ee268159(v=bts.10).aspx
Yes, that is expected behaviour.
What you want to do is
Distinguish the fields in the schema(s) (target and source, in your case they may be the same one if I understand what you are saying).
Have the map first making sure that your map creates the fields you want to populate with some dummy values.
Have an assignment shape after that just has one line for each of the fields in the format msgDestination.record.field = msgSource.record.field; (Note: you might have multiple levels of records).
This works only for non-reoccurring fields. For reoccurring fields you need to use a multi-part map instead.

Resources