Calling Instant Flow from SharePoint formatted column - sharepoint

I am trying to make a call to a Power Automate Instant Flow from a formatted column. I'm taking my inspiration from this article - https://www.inspiribytes.com/power-automate/deploying-a-single-flow-to-multiple-sharepoint-libraries-lists/
I set up the column with the json:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "button",
"customRowAction": {
"action": "executeFlow",
"actionParams": "{\"id\": \"0aa2105b-755e-4017-aac8-b1b823ea96d1\"}"
},
"attributes": {
"class": "ms-fontColor-themePrimary ms-fontColor-themeDarker--hover"
},
"style": {
"border": "none",
"background-color": "transparent",
"cursor": "pointer"
},
"children": [
{
"elmType": "span",
"attributes": {
"iconName": "Flow"
},
"style": {
"padding-right": "6px"
}
},
{
"elmType": "span",
"txtContent": "Start Approval"
}
]
}
I created my Instant FLow, and noted the ID in the URL and changed the JSON in the formatted column to match.
When I click the button, I see a message that says "Setting Up" - clicking it, it just says "Waiting"
When I review the Developer Console, I see the following message:
POST https://prod-176.westus.logic.azure.com/workflows/b294beca8451414787bae052f8be6181/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=8s7N19sj-J3iZjMy90RvM7xKkcvujUkQCBPWxB6rZcc 400
So I'm getting a Bad Request, but I cannot figure out why. There doesn't appear to be any other parameters that I should be setting other than the ID of the workflow.

In my test, I cannot reproduce your problem.
There is no problem with your JSON code. I suggest you provide the screenshots of your flow, which will help us solve the problem better.

Related

Create Azure DevOps task with description

I'd like to open a Bug using the Azure DevOps REST API and create it with a description. I couldn't find in the docs how to do it, I've only seen something about the title.
I've been trying to create a bug with a description by sending this body on the request:
[
{
"op": "add",
"path": "/fields/System.Title",
"from": null,
"value": "Sample task"
},
{
"op": "add",
"path": "/fields/System.Description",
"from": null,
"value": "Test of REST functionality"
}
]
But still no success...
The work item type Bug does not have the field Description. Instead, it has the field called Steps to Reproduce, which is probably what you're trying to set.
So, first of all you need to specify the type URI parameter to be a Bug, and change the payload to something like the following:
[
{
"op": "add",
"path": "/fields/System.Title",
"from": null,
"value": "Sample task"
},
{
"op": "add",
"path": "/fields/Microsoft.VSTS.TCM.ReproSteps",
"from": null,
"value": "Test of REST functionality"
}
]
I can't verify this to be 100% sure at the moment but hope this gives you enough information to try it out.

MS teams adaptive card not sending input text value on submit

I am 500% sure it used to work and all of a sudden this is broken. The card for getting input is no longer passing the value back to nodejs.
The card looks like below:
{
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "Note text"
},
{
"type": "Input.Text",
"placeholder": "Type a note",
"isMultiline": true,
"id": "noteIdVal"
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Save",
"data": { "action" : "add_note", "objNumber": objId, "objType": objectType }
},
{
"type": "Action.Submit",
"title": "Cancel",
"data" : {"action": "cancel"}
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
}
On the submit action, in my nodejs i am getting the data in the values node which are passed in the data field. However, it is no longer attaching noteIdVal. Did something changed from MS side?
MS Teams Adaptive card required special property with the name msteams to the object in an object submit action’s data property in order to access this functionality.
{
"type": "Action.Submit",
"title": "Click me for messageBack",
"data": {
"msteams": {
"type": "messageBack",
"displayText": "I clicked this button",
"text": "text to bots",
"value": "{\"bfKey\": \"bfVal\", \"conflictKey\": \"from value\"}"
},
"extraData": {}
}
}
The type property is "messageBack" the submit action will behave like a messageBack card action, which is like a combination of imBack and postBack.
Reference :
Microsoft Docs for MS Teams Adaptive Card
So, may be useful to other folks here. I have two showCards and the content of both the show cards has a common text field with same id name "noteIdVal". As ultimately it is a single json and hence was the culprit.
Lesson, have all fields unique id values which is easy to miss when you have multiple show cards

Edit event color using Python and Google API

I want to edit the color of an individual event as I insert it into a Google Calendar using Python to interact with the Google API. I'm using the dictionary below to compose the event itself, and I thought that colorId was a part of the event, but I feel like I'm fundamentally misunderstanding how to use to use it.
event = {
"summary": name,
"colorId": "Tangerine",
"start": {
"date": ymd,
},
"end": {
"date": ymd,
},
"recurrence": [
"RRULE:FREQ=YEARLY;COUNT=100",
],
}
event = service.events().insert(calendarId="id number of calendar goes here", body=event).execute()
However, I don't really know how to go about fixing this. Any help is appreciated.
Ahh, cripes. Answer is straightforward. The dictionary is properly formatted as it stands, but the input under "colorId" should be a numeric string (e.g., "6", etc.). Reference can be found here: https://jsfiddle.net/ztjga41q/
event = {
"summary": name,
"colorId": "6",
"start": {
"date": ymd,
},
"end": {
"date": ymd,
},
"recurrence": [
"RRULE:FREQ=YEARLY;COUNT=100",
],
}

Is it possible to change verbiage of listAuditEvents?

The current [Envelopes: listAuditEvents] creates the following verbiage for correction:
"eventFields": [
{
"name": "logTime",
"value": "2018-09-18T19:09:01.3603686Z"
},
{
"name": "Source",
"value": "api"
},
{
"name": "UserName",
"value": "Staging"
},
{
"name": "UserId",
"value": "8c57af14-e46a-4965-ae8b-42bb0c29b706"
},
{
"name": "Action",
"value": "Correction Initiated"
},
{
"name": "Message",
"value": "Staging initiated correction"
},
{
"name": "EnvelopeStatus",
"value": "correct"
},
I would like to modify the Message values. I have gone through Docusigns API but I have not found any indication that this is possible.
Has anyone had the same need? and if so were you able to add custom message verbiage for certain events/actions?
Thanks.
It's not possible for you to configure the contents of the API response for the listAuditEvents operation. However, you could (in your code) include logic to parse the API response and based on certain values in the response, substitute values (for purposes in your app) with the verbiage you prefer.
For example, let's say that you have a page in your app that displays the various events that have occurred for an Envelope, but you don't want to display the verbiage "[UserName] initiated correction" as the text in your UI when a user initiates an envelope correction -- instead you want to display the text "[UserName] changed envelope settings." The logic in your code could do something like this psuedo code shows (where auditEvent represents an object within the API response body for the listAuditEvents operation):
if (auditEvent.ActionInitiated == "Correction Initiated") {
displayMessageInUI(auditEvent.UserName + " changed envelope settings.");
}

Insert a card that can be directly responded to

update !important: The API has changed a lot, this question shouldn't be taken into consideration anymore
I am trying to use the REST api (via Node.js API) to create cards that the user can respond to and create an interaction in this way.
Reading the docs the creator attribute is not really specified anywhere, so I have no idea how to insert that.
Also this video doesn't help. Nor this guide =)
I believe there is an URL I should set as callback somehow? I'd like to know how to get these responses, please.
update
This is the card I am sending.
{
bundleId: 'veryuniqueBundle',
id: 'veryuniqueBundle:reply',
text: "want to hear moar?",
menuItems: [
{action: "REPLY"}
]
}
that's the response I get:
{
"collection": "timeline",
"itemId": "119c4dc8-c0ce-4a83-aa76-41aab4e8dbe1",
"operation": "INSERT",
"verifyToken": "42",
"userToken": "id:520ef63cde31145deb000001",
"userActions": [
{
"type": "REPLY"
}
]
}
The problem is, I can't see what the user responded (an text) and the reference to the original card id (or bundle) that was responded to. How can I get those
Cards do not provide a direct callback. Instead, when a user selects a menu item it causes the card to be updated with their menu selection. This change subsequently triggers a notification ping to your timeline subscription.
Follow these steps to detect a menu item selection:
Subscribe to notifications for changes in the timeline collection
{
"collection": "timeline",
"userToken": "awesome_kitty",
"verifyToken": "random_hash_to_verify_referer",
}
Insert a timeline card with a custom menu item
{
"text": "Hello world",
"menuItems": [
{
"action": "CUSTOM",
"id": "complete"
"values": [{
"displayName": "Complete",
"iconUrl": "http://example.com/icons/complete.png"
}]
}
]
}
Select the item on Glass
Receive the notification on your subscription URL
{
"collection": "timeline",
"itemId": "3hidvm0xez6r8_dacdb3103b8b604_h8rpllg",
"operation": "UPDATE",
"userToken": "harold_penguin",
"userActions": [
{
"type": "CUSTOM",
"payload": "PING"
}
]
}
Do cool stuff in your code
???
Profit

Resources