Setting SharePoint Folder Modified Date through JSON - power-automate

I am trying to change SharepointSite>Document>Folder>ModifiedDate to current date. I have no idea how to write JSON but looking at a few examples, I have kludged together the following. Clearly it does not work.
"host":
"connectionName": "shared_sharepointonline",
"operationId": "HttpRequest",
"apiId": "/providers/Microsoft.PowerApps/apis/shared_sharepointonline"
"parameters":
"dataset": "https://splm.sharepoint.com/sites/PresentationsinProgress",
"parameters/method": "GET",
"parameters/uri": "_api/web/documents/fields/getbyID('<Modified>')",
"parameters/body": "fileOrFolder.setLastModified( yourDateInMilliseconds );"
"authentication": "#parameters('$authentication')"

You could use the ValidateUpdateListItem for this.
Try something like below.
{
"formValues":[
{
"FieldName": "Modified",
"FieldValue": "8/24/2022"
}
],
"bNewDocumentUpdate": true
}

Related

MSAL4J - Token not found in the cache

When attempting to use the method PublicClientApplication.acquireTokenSilently() I am getting the error "Token not found in cache". It looks like it is failing to be stored. Our AuthenticationResult looks like this:
{
"accessToken": "...",
"expiresOn": 1671035322,
"extExpiresOn": 0,
"refreshOn": 0,
"idToken": "...",
"idTokenObject": {},
"accountCacheEntity": {
"homeAccountId": "...",
"environment": "URL",
"name": "username",
"authorityType": "ADFS"
},
"account": {
"value": {
"homeAccountId": "...",
"environment": "URL"
}
},
"tenantProfile": {},
"environment": "env",
"expiresOnDate": {
"value": "Dec 14, 2022 11:28:42 AM"
},
"scopes": "openid"
}
I see that the account is missing the "name" field and I am wondering if that is part of it. I'm not quite sure how to work around this issue.
I've looked at the source and it appears that result.account().username() is returning null. I'm not sure if there is a way to use the value in accountCacheEntity.

How to change the local payload when invoking a lambda in cloud9 IDE?

I'm developing in AWS Cloud9, and have a basic "Hello, World" API set up using Lambda.
Now I would like to iterate so that the API can accept parameters. Cloud9 used to have a convenient UI for modifying the payload when running "local" (in the IDE, without deploy). But I can't find where this has been moved, and the documentation still references the previous UI.
To test this, I've included a simple print(event) in my Lambda, and started modifying various components. So far I only print an empty dict ({}).
I suspect it's in the launch.json but so far everything I've modified has not been picked up. Showing below
{
"configurations": [
{
"type": "aws-sam",
"request": "direct-invoke",
"name": "API token-to-geojson:HelloWorldFunction (python3.9)",
"invokeTarget": {
"target": "api",
"templatePath": "token-to-geojson/template.yaml",
"logicalId": "HelloWorldFunction"
},
"api": {
"path": "/hello",
"httpMethod": "get",
"payload": {
"json": {}
}
},
"lambda": {
"runtime": "python3.9"
}
},
{
"type": "aws-sam",
"request": "direct-invoke",
"name": "token-to-geojson:HelloWorldFunction (python3.9)",
"invokeTarget": {
"target": "template",
"templatePath": "token-to-geojson/template.yaml",
"logicalId": "HelloWorldFunction"
},
"lambda": {
"payload": {
"ticky": "tacky"
},
"environmentVariables": {},
"runtime": "python3.9"
}
}
]
}
The only thing I saw is we need to add "json" before the actual json data. In the example below, it appears the IDE already knows the id is event.id (note event is the first argument of the handler).
"lambda": {
"payload": {
"json": {
"id": 1001
}
},
"environmentVariables": {}
}

swagger: how to validate formData

So far I'm able to do swagger validation if the parameters are from "in": "body" or if the input expected is in a json format.
However, I can't find how to validate a simple string entered as formData.
Below is my swagger script (in json format)
v1swag = {
"cancels_post": {
"tags": ["/api/v1"],
"parameters": [
{
"name": "token",
"in": "formData",
"type": "string",
"required": True,
"description": "Cancels the provided token.",
}
],
"responses": {
"200": {
"description": "Success!",
}
}
}
}
I removed the schema as it seems to only work for "in": "body"
I've been searching the net but can't seem to find the light.
Though I will still be searching... Any hints would be greatly appreciated.
Thank you very much in advance.
A different source media type has to be consumed here. Specify "consumes" member to include media type of application/x-www-form-urlencoded.
v1swag = {
"cancels_post": {
"tags": ["/api/v1"],
"consumes": [
"application/x-www-form-urlencoded"
],
"parameters": [
{
"name": "token",
"in": "formData",
"type": "string",
"required": True,
"description": "Cancels the provided token.",
}
],
"responses": {
"200": {
"description": "Success!",
}
}
}
}

FHIR DSTU2: What is the correct way to represent an extension value as a collection?

I'm currently looking into creating a FHIR DSTU2 extension. I need the extension to return a collection of values. What is the correct way to represent this in FHIR DSTU2?
Should it be a list of extensions within an extension:
"resource": {
"resourceType": "Medication",
"extension": [
{
"url": "http://www.myextension.com/strengths",
"extension": [
{
"url": "http://www.myextension.com/strength",
"valueStrength": "5mg"
},
{
"url": "http://www.myextension.com/strength",
"valueStrength": "20mg"
}
]
}
],
}
Or should it be one extension with a collection on the value?
"resource": {
"resourceType": "Medication",
"extension": [
{
"url": "http://www.emis-online.com/strengths",
"valueStrengths": [
"5mg",
"20mg"
],
}
],
}
Thanks.
It would actually look like this:
"resource": {
"resourceType": "Medication",
"extension": [
{
"url": "http://www.myextension.com/strength",
"valueString": "5mg"
},
{
"url": "http://www.myextension.com/strength",
"valueString": "20mg"
}
]}
As well, it'd be better to use valueQuantity than valueString - to split the value and the unit.
That said, there's no reason to use an extension for drug strengths at all. Medication.product.ingredient.amount is strength - if the ingredient is an active ingredient. (I see that the resource doesn't currently allow distinguishing active from excipient ingredients, so I'd encourage raising a change request on that.)

how to simulate json format and parse in ruby

I'm trying to simulate a json response by attaching it to a variable.
myjson = {'link':{
'href':'erwerweirwierwe',
'rel':'self'
},
'plan':{
'shortName':'Chrome',
'shortKey':'MASTERFULL',
'type':'chain',
'enabled':true,
'link':{
'href':'something',
'rel':'self'
},
'key':'MASTERFULL',
'name':'teserere'
}
when i try to parse the above, i get an error:
parsedJson = JSON.parse(myjson)
do i need to format the raw json before reading it this way?
You have to use double quotes, not single quotes.
You can validate your json using this web service.
Also, in your example, you're missing the last closing brace.
The following JSON validates:
{
"link": {
"href": "erwerweirwierwe",
"rel": "self"
},
"plan": {
"shortName": "Chrome",
"shortKey": "MASTERFULL",
"type": "chain",
"enabled": true,
"link": {
"href": "something",
"rel": "self"
},
"key": "MASTERFULL",
"name": "teserere"
}
}

Resources