It was pretty straight forward setting up a connection to Google Drive since there was options for it in the Logic App Designer. But I can't find any similar options for connecting to Google Cloud Storage.
Am I missing something or do I have to go with a Function App in Azure and write my own code for connecting to GCP?
"actions": {
"Create_file": {
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"name": "#parameters('$connections')['googledrive']['connectionId']"
}
},
"method": "post",
"body": "#body('Get_blob_content_using_path')",
"path": "/datasets/default/files",
"queries": {
"folderPath": "/GcpExportTest",
"name": "#triggerBody()?['Name']",
"queryParametersSingleEncoded": true
}
}
}
}
...
"parameters": {
"$connections": {
"value": {
"googledrive": {
"id": "[concat(subscription().id, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'googledrive')]",
"connectionId": "[resourceId('Microsoft.Web/connections', parameters('googledrive_1_Connection_Name'))]",
"connectionName": "[parameters('googledrive_1_Connection_Name')]"
}
}
}
}
As of this writing, there isn't a built-in connector in Logic Apps yet for interacting with Google Cloud Services specifically, however, because Logic Apps is great with anything RESTful and Google Cloud Storage does provide REST API, there are multiple ways you can go about to accomplish what you want, and using Azure Functions is definitely one of them.
Alternatively, if your desired workflow is something simple and you'd rather work in the LA designer view like you did with Google Drive connector, you have HTTP connector in Logic Apps at your disposal too: you would include the authentication bearer token in your request and call the specific Google Storage endpoint that executes the desired task (get, list, delete etc..) against bucket/object.
Related
Is there a way to trigger an Azure pipeline by using something similar to a POST call or from inside a Power Automate flow?
Similarly to how a Power Automate flow can be triggered from an HTTP Request.
Yes you can use Run API endpoint
POST https://dev.azure.com/{organization}/{project}/_apis/pipelines/{pipelineId}/runs?api-version=6.0-preview.1
as body if you want to trigger build on main branch use this json
{
"resources": {
"repositories": {
"self": {
"refName": "refs/heads/main"
}
}
}
}
And if you don't know how to authenticate this documentation explain you how to use PAT token
Currently, I am developing a DB2 database-driven IBM Watson Assistant chatbot in Facebook page, integrated with IBM Cloud Functions. I have established the connection and able to send and receive messages on Facebook.
Now, I am trying to send Generic templates referencing to Facebook developer doc and implement a carousel of cards in facebook with images, titles and buttons.
Things I tried: According to IBM documentation, I tried message.attachment.payload (specified in facebook developer doc) inside output.facebook in Watson JSON editor.
{
"output": {
"generic": [{
"values": [{
"text": "ok"
}],
"response_type": "text",
"selection_policy": "sequential"
}],
"facebook": {
"text": "Hi,\n\nWe have a great giveaway for you, but first we’d like for you to follow us so that you can stay updated on the latest news and trends.\n\nPlease take a moment to follow us and let me know when you've followed us by typing DONE:\n\n",
"buttons": [{
"url": "https://www.facebook.com/ibmcommerce/",
"type": "web_url",
"title": "Follow IBM Commerce",
"messenger_extensions": "false",
"webview_height_ratio": "full"
}],
"template_type": "generic"
}
}
}
Also, I tried implementing the solution provided in IBM Watson developer forum
{
"output": {
"facebook": {
"message": {
"attachment": {
"type": "template",
"payload": {
"text": "Hi,\n\nWe have a great giveaway for you, but first we’d like for you to follow us so that you can stay updated on the latest news and trends.\n\nPlease take a moment to follow us and let me know when you've followed us by typing DONE:\n\n",
"buttons": [
{
"url": "https://www.facebook.com/ibmcommerce/",
"type": "web_url",
"title": "Follow IBM Commerce",
"messenger_extensions": "false",
"webview_height_ratio": "full"
}
],
"template_type": "button"
}
}
}
}
}
}
Neither of the solutions works for me. Kindly help me in figuring out what I am missing.
Any help is much appreciated. Thanks in advance!
update your webhook to an April version (2020-04-01)
instead of output.facebook use output.integrations.facebook
I have created a Webhook (https://moviebotdf.herokuapp.com/get-movie-details), it is tested with postman and dialogflow and working properly.
I want to integrate it with IBM Watson Assistant via programmatic call, but this is not returning anything (i.e. the output is "").
I checked the IBM support (https://cloud.ibm.com/docs/services/assistant?topic=assistant-dialog-actions&locale=en) and also other solutions as calling a function that could call the webhook but I am having even less succcess there. As I understand from the support, a direct call from the Assistant to the Webhook should be possible (and easier for newbies like me), hence is the solution I seek. Code in the Assistant is as follows:
{
"context": {
"skip_user_input": true,
"prodname": "$prodname"
},
"output": {
"text": {
"values": [
"$dataToSend"
],
"selection_policy": "sequential"
}
},
"actions": [
{
"name": "https://moviebotdf.herokuapp.com/get-movie-details",
"type": "client",
"parameters": {
"prodname": "$prodname"
},
"result_variable": "context.dataToSend"
}
]
}
So "prodname" is captured by Watson Assistant in the previous node (I checked that and it is working correctly) and sent to the Webhook. The variable used in the Webhook is also called "prodname". The expected output from the Webhook is stored in the variable "dataToSend", but as said above the answer in Watson is only "" as "$dataToSend" is "".
I tried also with "result_variable": "dataToSend" and "result_variable": "$dataToSend" without success, so what I guess is that the webhook is not being called...
I am new in the topic, so please do not hesitate to correct any problems in my post.
Thanks in any case in advance!
Adrià
IBM Watson Assistant lists three different options of making a programmatic call from within a dialog node:
client: your app is in charge of calling out to the action
server or cloud_function: IBM Cloud Functions action is invoked from Watson Assistant
web_action: The web action of an IBM Cloud Functions action is invoked from Watson Assistant
If you host your webhook on IBM Cloud Functions, then Watson Assistant can directly call it. With your current hosting and client specified, your app is in charge. In that case your app needs to check that the context includes the information about a client action, extract that related metadata, invoke the webhook and send the data back to Watson Assistant.
I have written an example for such a client action for my Watson conversation tool. See that repo for instructions.
I have a project with Actions on Google, Dialogflow & an AWS Lambda to manage the fulfilment. On the backend (NodeJs) I use actions-on-google (v2)
const {dialogflow} = require('actions-on-google');
const app = dialogflow({debug: true});
app.intent('StartIntent', (conv) => {
console.log('Hello AWS');
conv.ask('Hello AWS');
});
exports.handler = app
Dialogflow is configured with one Intent StartIntent & with webhook fulfilment.
Everything seems to work fine when I test with the Actions on Google simulator. I got the expected answer 'Hello AWS'.
However, it doesn't work with the dialogflow simulator. There is no answer, although I can read "Webhook execution successful" in the Diagnostic Info, with the correct fulfilment response:
{
"payload": {
"google": {
"expectUserResponse": true,
"richResponse": {
"items": [
{
"simpleResponse": {
"textToSpeech": "Hello AWS"
}
}
]
},
"userStorage": "{\"data\":{}}"
}
},
"outputContexts": [
{
"name": "projects..../_actions_on_google",
"lifespanCount": 99,
"parameters": {
"data": "{}"
}
}
]
}
This seems really strange to me, as the Actions on Google just make a call to dialogflow and that return a good response. Whereas testing dialogflow alone doesn't work.
Any idea ?
This is expected. The actions-on-google library has its output tuned for the Google Assistant integration. It doesn't try to include output that would be used by generic Dialogflow agents, which is what the Dialogflow test field uses.
If it works in the Assistant Simulator - you should be good.
Update
To be specific, the actions-on-google library sets values in payload.google.richResponse in the JSON response which set the messages that are displayed by the Google Assistant. As the name suggests, this is Google-specific output, so the Dialogflow test side-bar (as well as other agents that work with Dialogflow) ignore this section.
Dialogflow has generic ways of sending messages back including the fulfillmentText and fulfillmentMessages fields in the JSON response. The Dialogflow test side-bar uses these fields to display results. The actions-on-google library does not set, or use, these fields, so results aren't available.
I have follow the documentation, and I created a pkg json like this and the simulator is not working I create this post to change the information with Google community.
https://plus.google.com/communities/105684267327487893574/stream/1dec6e34-163c-4f1a-883a-548cff52b522
The doc I sued to create the smart home is : https://developers.google.com/actions/smarthome/create-app#request
{
"actions": [{
"name": "actions.devices",
"deviceControl": {
},
"fulfillment": {
"conversationName": "automation"
}
}],
"conversations": {
"automation" :
{
"name": "automation",
"url": "My ACTION Handler Url API"
}
}
}
I configure the action
The simulator's default text is incorrect in the case of Smart Home actions. In a house you do not talk to your lights and ask them to turn off. You should just say "turn on my lights" without invoking any third-party app.
First, you need to go to the Home Control settings in the Google Assistant settings. There, you can link your Google account to the Smart Home server and SYNC your devices.
After that, you can directly control them without actually passing into a third-party conversation. The simulator does support these commands and will respond correctly once you do the account linking. However, it is different from a conversation.