Tracked Properties of Logic Apps
I am trying to track properties in a Logic App workflow. My problem is I need to track some fields coming from HTTP action.
So my output of HTTP action is something like below.
{
"statusCode": 200,
"headers": {
"x-ms-request-id": "asdfsad",
"x-ms-client-request-id": "ASFSDF",
"x-ms-version": "2020-10-02",
"x-ms-creation-time": "Fri, 05 Nov 2021 12:55:54 GMT",
"x-ms-lease-status": "unlocked",
"x-ms-lease-state": "available",
"x-ms-blob-type": "BlockBlob",
"x-ms-server-encrypted": "true",
"Accept-Ranges": "bytes",
"Date": "Wed, 10 Nov 2021 07:52:11 GMT",
"ETag": "\"SDFGSDGF\"",
"Server": "Windows-Azure-Blob/1.0,Microsoft-HTTPAPI/2.0",
"Content-Length": "1996",
"Content-MD5": "co+35ZaNw7Be9sgn6YB7OA==",
"Content-Type": "text/xml",
"Last-Modified": "Wed, 10 Nov 2021 07:52:11 GMT"
},
"body": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Customer xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://company.Schemas\">\r\n <Company xmlns=\"\">\r\n <CompanyCode>dk01</CompanyCode>\r\n <CompanyIdEcom />\r\n <BillTo>\r\n <CustomerNo>4004002</CustomerNo>\r\n <CreditLimit>0</CreditLimit>\r\n <BlockingLevel>0</BlockingLevel>\r\n <CurrencyCode>DKK</CurrencyCode>\r\n <PaymentTerms>N30</PaymentTerms>\r\n <BillToAddress>\r\n <PostalCode>2750</PostalCode>\r\n </BillToAddress>\r\n <SellTo>\r\n <SellToAddress>\r\n <Address>Lautrupbjerg 7 Postbox 99</Address>\r\n <PostalCode>2750</PostalCode>\r\n <CountryCode>DK</CountryCode>\r\n </SellToAddress>\r\n <ShipTo>\r\n <Code>5637147732</Code>\r\n <ShipToAddress>\r\n <Name>Siemens Medical Instr. Pte.Ltd</Name>\r\n <City>Singapore</City>\r\n <PostalCode>139959</PostalCode>\r\n <CountryCode>SG</CountryCode>\r\n </ShipToAddress>\r\n </ShipTo>\r\n <CustomerNo>4004002</CustomerNo>\r\n <Name>GN Audio A/S</Name>\r\n <Searchname>1000-500092,5479</Searchname>\r\n <CurrencyCode>DKK</CurrencyCode>\r\n <PrimaryContactEmail />\r\n <ModeOfDelivery>AIR DHL EX</ModeOfDelivery>\r\n </SellTo>\r\n </BillTo>\r\n </Company>\r\n <IsDelta xmlns=\"\">true</IsDelta>\r\n</Customer>"
}
I am not able to figure out how I can track Customer no from the XML.
outputs('HTTP-GetBlob')?['body'] (..??????.....)
As far as I remember, tracked properties can only reference #triggerBody, current #action()['inputs'] and #action()['outputs'] - nothing else.
In your case, you'd need to configure tracked properties on your HTTP-GetBlob action like this:
#xpath(xml(action()['outputs']['body']), '(//CustomerNo/text())[1]')?[0]
- experiment with xpath and adjust it to your liking.
One of the workarounds that you can try is to convert the XML into JSON then parse it and then use the required parameters accordingly.
Here are the screenshots for your reference
Here is the output
Related
Anyone know how to find metadata from react-dropzone. Currently out of the box it just shows the following:
path: "DSCF2953.jpg"
lastModified: 1643308695461
lastModifiedDate: Thu Jan 27 2022 10:38:15 GMT-0800 (Pacific Standard Time) {}
name: "DSCF2953.jpg"
size: 1442377
type: "image/jpeg"
It shows nothing about the date created type of camera and on....
Is there a way to get to extra file data ?
We are creating an Extension in AL to import orders.
For this question we have simplified our extension to explain the challenges we are facing.
What we would like to do is import header + lines in Dynamics 365 Business Central.
To achive this we we have:
- Created a table (Header)
- Created a table (Lines)
- Created a page of Type API (Doc)
- Created a listPart (SalesLine)
Scenario 1
We have published page DOC and are trying to do a post request to this odata url.
POST https://api.businesscentral.dynamics.com/v1.0/{tennant}/Sandbox/ODataV4/Company('CRONUS%20NL')/Doc/ HTTP/1.1
Content-Type: application/json
Authorization: Basic {{username}} {{password}}
{
"name": "Description",
"SalesLines" : [{"lineno" : 1000}]
}
The response:
{
"error": {
"code": "BadRequest",
"message": "Does not support untyped value in non-open type."
}
}
Scenario 2
When we post:
POST https://api.businesscentral.dynamics.com/v1.0/3{tennant}/Sandbox/ODataV4/Company('CRONUS%20NL')/Doc/ HTTP/1.1
Content-Type: application/json
Authorization: Basic {{username}} {{password}}
{
"name": "Description"
}
We get the following response:
{
"#odata.context": "https://api.businesscentral.dynamics.com/v1.0/3ddcca3d-d343-4a06-95f9-f32dbf645199/Sandbox/ODataV4/$metadata#Company('CRONUS%20NL')/Doc/$entity",
"#odata.etag": "W/\"JzQ0O3BKUzExSUMrQUl4UXFQc2R6V1J1ellvZEttRTJoa2xhanNtV0M0K3Ezajg9MTswMDsn\"",
"id": 4,
"name": "Description",
"DateTime": "2019-05-20T19:33:13.73Z"
}
I have published our extension on GitHub
Help would be appriciated.
I have worked on a similar solution and found that the following things were required for it to work:
The part containing your lines must be placed inside the repeater on your header Page.
You must set the EntityName and EntitySetName on your part to the same values as on the actual page.
When calling the API you must append the parameter $expand=[EntitySetName of your lines part] e.g $expand=orderLines.
In the JSON body the property name of the array containing the lines must match the EntitySetName of the lines part.
I can provide some examples if the instructions above do not suffice.
When updating the certificates via the Appengine Admin API I consistently get an unknown error. I've moved to the API explorer (https://developers.google.com/apis-explorer/) to rule out any other errors.
I populate all the fields (appsId, authorizedCertificatesId, updateMask, and patch body) with relevant data.
The Result is a 200 accepted, but an unknown error javascript dialog box is popped as a response. Additionally the new certificate doesn't get utilized.
Actual response
200 OK - Hide headers - cache-control: private content-type: application/json; charset=UTF-8 date: Thu, 20 Jul 2017 10:24:42 GMT server: ESF transfer-encoding: chunked vary: Origin, X-Origin, Referer { "name": "apps/xxx-162220/authorizedCertificates/34643", "id": "34643", "displayName": "Try3", "domainNames": [ "xxx.de", "www.xxx.de" ], "expireTime": "2017-11-18T09:22:00Z", "certificateRawData": { "publicCertificate": "-----BEGIN CERTIFICATE-----\nMIIFDTCCAxxx\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEkjCCAxxx\n-----END CERTIFICATE-----\n" }}
Is this a bug as it's in beta or is someone able to complete this successfully? The api is appengine.apps.authorizedCertificates.patch
I am using the "insert" API to add a message to Gmail, and using the query parameter internalDateSource=dateHeader. However Gmail seems to ignore the "Date" header that is in my RFC822 data, just substituting the current date. My POST url looks like this:
https://www.googleapis.com/gmail/v1/users/user#gmail.com/messages?uploadType=multipart&internalDateSource=dateHeader&access_token=XYZ
My uploaded data looks like this:
{
"labelIds": [ "Label_96" ],
"raw": "RnJvbTo...tDQr_"
}
There is no doubt that the correct "Date" header is in the encoded raw
data. (Here is an example):
Date: Wed, 1 Oct 2011 10:47:00 -08:00
Google picks up all the other headers and message data correctly. What am I doing wrong? BTW I did try adding "payload" and "headers" to my json in an attempt to specify a Date header. No change.
You have a typo in your Date-header. It should be:
Date: Wed, 1 Oct 2011 10:47:00 -0800
not
Date: Wed, 1 Oct 2011 10:47:00 -08:00
It seems that over night the Google Drive API methods files().patch( , ).execute() has stopped working and throws an exception. This problem is also observable through Google's reference page https://developers.google.com/drive/v2/reference/files/patch if you "try it".
The exception response is:
500 Internal Server Error
cache-control: private, max-age=0
content-encoding: gzip
content-length: 162
content-type: application/json; charset=UTF-8
date: Thu, 22 Aug 2013 12:32:06 GMT
expires: Thu, 22 Aug 2013 12:32:06 GMT
server: GSE
{
"error": {
"errors": [
{
"domain": "global",
"reason": "conditionNotMet",
"message": "Precondition Failed",
"locationType": "header",
"location": "If-Match"
}
],
"code": 500,
"message": "Precondition Failed"
}
}
This is really impacting our application.
We're experiencing this as well. A quick-fix solution is to add this header: If-Match: * (ideally, you should use the etag of the entity but you might not have a logic for conflict resolution right now).
Google Developers, please give us a heads up if you're planning to deploy breaking changes.
Looks like sometime in the last 24 hours the Files.Patch issue has been put back to how it used to work as per Aug 22.
We were also hitting this issue whenever we attempted to Patch the LastModified Timestamp of a file - see log file extract below:
20130826 13:30:45 - GoogleApiRequestException: retry number 0 for file patch of File/Folder Id 0B9NKEGPbg7KfdXc1cVRBaUxqaVk
20130826 13:31:05 - ***** GoogleApiRequestException: Inner exception: 'System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at Google.Apis.Requests.Request.InternalEndExecuteRequest(IAsyncResult asyncResult) in c:\code.google.com\google-api-dotnet-client\default_release\Tools\BuildRelease\bin\Debug\output\default\Src\GoogleApis\Apis\Requests\Request.cs:line 311', Exception: 'Google.Apis.Requests.RequestError
Precondition Failed [500]
Errors [
Message[Precondition Failed] Location[If-Match - header] Reason[conditionNotMet] Domain[global]
]
'
20130826 13:31:07 - ***** Patch file request failed after 0 tries for File/Folder 0B9NKEGPbg7KfdXc1cVRBaUxqaVk
Today's run of the same process is succeeding whenever it Patches a files timestamp, just as it was prior to Aug 22.
As a result of this 4/5 day glitch, we now have hundreds (possibly thousands) of files with the wrong timestamps.
I know the API is Beta but please, please Google Developers "let us know in advance of any 'trialing fixes'" and at least post in this forum to acknowledge the issue to save us time trying to find the fault in our user programs.
duplicated here Getting 500: Precondition Failed when Patching a folder. Why?
I recall a comment from one of dev videos saying "use Update instead of Patch as it has one less server roundtrip internally". I've inferred from this that Patch checks etags but Update doesn't. I've changed my code to use Update in place of Patch and the problem hasn't recurred since.
Gotta love developing against a moving target ;-)