I'm using Azure logic apps to post a Teams message (using v3) to a channel that we have upon a trigger. When I'm trying to add a dynamic link to the content that I'm posting - it fails.
If I use an example message like below, where the SomeAction is generating a json result and the .link is a URL property:
`Example message looks like this`
< and > characters get encoded and I lose the clickability of the text.
Looks like in Microsoft Flow - they have an html icon button which seemingly turns off the encoding - see here: https://powerusers.microsoft.com/t5/Power-Automate-Ideas/Flow-Bot-unable-to-add-clickable-URL-to-Teams/idi-p/277965
so it looks like this:
but logic apps don't have the same button. If I try to add link using a static URL with the button that's provided, it works. I can't use Microsoft Flow, because it's functionalities compared to logic-apps seems to be somewhat limited.
I'm wondering if there's any way of posting a dynamic link in Microsoft Teams using logic apps?
I've figured this out.
As I've said before if we just added <a href="body('SomeAction').link]"> the tags get encoded.
Turns out this encoding happens only when we add text / code through the online editor / textbox.
The trick is to navigate to Code View and ensure the encoding is removed through the arm template.
Related
I want to develop a blog application with Django backend and React frontend. I shall be using Postgresql.
I want to use a rich text editor like Quill to write the blog article. My questions:
I heard that article written in a text editor needs to be converted to HTML before saving in the database. If so, how do I do this in Django Rest Framework?
How do I present the article keeping the same style and formatting in the frontend from the database?
Say, I include multiple photos in the article. How do I save all the photos in the database? i.e. what should be the schema then?
I want to have my doubts clear before I jump in.
I'm also doing the same thing at the moment. For your answers :
In DRF, the simplest way to post the data is by using Textfield in your model. Rich text field (with Tags) will be stored in the Postgres. In the Admin page or the DRF API you'll see something like this
Then, to re-render it to the front end, you can use any HTML Parser library. for example I'm using "react-html-parser" that simply convert the rich text into the defined styling.
As for Image, this is a bit tricky, and I havent done this part myself but what i could think of right now is you would create another model & end points to store the images.
when sending the post request to the django, you would convert the base file path/url from the front end to back end. example :
original > http://localhost:3000/image/efewf23r.jpg
new (django) > http://localhost:8000/media/img/img_model/efewf23r.jpg
then do a second post request to the image itself and make sure django would rename the the file as per what we set above.
Let me know if you found a better solution.
It's been long since I posted this question. After that, I have gained enough working knowledge to make Quill.js (the rich text editor I'm using) work with React.JS, or, in my case Next.JS. So, this is focused on Quill.js only. The Quill npm package more specific to ReactJS is react-quill. I am presenting it as beginner friendly as possible.
A built-in function is provided with Quill: editor.getHTML(). editor is the current editor instance, where one types the content. This method generates the innerHtml of the content one prepares in the editor.
To save it to the databse, simply POST it to your back-end. But you must sanitize this innerHtml before passing it to the database. Can't say about server-side but I had to do this sanitization on the client-side. One good package is DOMPurify. You need to save this to the database if you want to present it in the same manner as it was typed in the browser.
The first point also provides the solution to my 2nd question. But one important point: The content one writes in Quill editor is also available as a JSON like format called quill-delta. You can get the delta with the function editor.getContents(). You need to POST it to the database if you want to edit the content in a later time.
To edit, you need to get this delta from the database and then initialize Quill editor with this delta in the value attribute.
For example, the text in orange is the delta representation of the text in the editor:
codepen source.
There is another function editor.getText() which extracts all the text from the editor.
Photos. Generally in Quill, you simply put the photo in the editor and Quill generates a base64 encoded delta for the photo. It's this easy. You don't need to worry about separate image fields.
I have an issue with share/like button from Angular app. I finally made it working correctly with links but share/like preview if completely wrong. I tried XFBML.parse(), switching to html 5 mode, etc.
There are two complete enigmas:
1. I got "Given URL is not allowed by the Application configuration..." despite adding all possible variants to fb app setting.
When share preview appear - it has "Angular", but I never added it anywhere.
Here is the link
Would be grateful for any ideas...
Thx
The Facebook Scraper only looks at the HTML code your server delivers, it does not execute any JavaScript.
So if you want to share different articles, you need an individual URL for each article, that delivers the relevant meta data when requested from the server.
You can find some more explanation and hints on how to implement this in this article, http://www.michaelbromley.co.uk/blog/171/enable-rich-social-sharing-in-your-angularjs-app
How do I get Response/Request URLs (which are shown in F12 Developer tools - Network Tab) using QTP 11? Based on these URLs, I need to perform certain action in my application. Is there any alternate solution to get those URLs?
Scenario: Open IE browser and navigate to a URL, Press F12, Go to 'Network' tab. Click on 'Start Capturing' button. Now click on any button or link on the page, you will get a set of URLs in the Developer Tool (F12).
Firstly, do you need all of the URL requests generated from a button and/or link click? Remember that what you get from the "Network" tab in the developer tools also include URL's for fetching e.g. Javascript and CSS in addition to, for instance a GET request to an external API.
I'll try an provide you with an alternative approach. If what you are really requiring is the URL associated with each interactive element, then you should be able to get that by using the GetROProperty method like so:
strURL = Browser("YourBrowser").Page("MainPage").WebButton("aButton").GetROProperty("href")
A more generic script for fetching e.g. all the "href" properties for all the links on a page may be found in the following post: (HP QuickTest) How do I get HTTP status using QuickTest?.
Hope this helps.
UPDATE: With regards to your question regarding fetching of the URL's from the IE developer tools; As far as I know there is no way to fetch them from this view by using QTP.
I'm sure I am missing something obvious, but How do you provide the moveTo functionality like a djxmLineItem has in javascript in the case where I need to use a button to set fields in addition to switching mobile pages?
You can't use server side to execute the mobile moveTo as these actons are handle by dojo client side code.
One option I've used in the past is to use a document "postSaveDocument" to call the moveTo.
e.g.
<xp:dominoDocument .....>
<xp:this.postSaveDocument>
<xe:moveTo ...>
</xe:moveTo>
</xp:this.postSaveDocument>
</xp:dominoDocument>
In my example I needed to maually add some data to a document with server side code ad faced the same issue, I found this to be a good solution as it won't run until the document has been saved, meaning all validation will run fine.
You can compute the moveTo property and thereby set fields before moving to the desired XPage.
Have a look at the answer here: XPages Mobile Controls - how to program the Back button
We have a Winforms application which supports dragging and dropping chunks of HTML into Outlook (HTML) mail messages.
Chunks of text are fine.
But how do we proceed with images? Let's assume we don't want to host the images online but instead we want to send them with the email message. Assume also that we do want to see the image inline, not as an attachment (where the recipient's email client supports that, of course).
If you look at the HTML source of an Outlook message there are "cid" tags for images (which point to the image as an attachment I guess), but how do we go about generating a cid/contentid?
If a manual step in the process is an option, you can do it like this:
create the HTML automatically or manually as a saved HTML file, with <img> tags that link to locally-saved image files
attach the HTML to an Outlook email using the 'Insert as text' option tucked away under the down-arrow on the "Insert" button when selecting the HTML file as an attachment.
This populates the HTML email with the HTML from the file and embeds all images. I believe this tool uses Base64 encoding to embed the images as described in Sam's email.
Depending on the workflow, this method might be easier than converting images to Base64 yourself.
Note that this method only works in Outlook for Windows, not Outlook for Mac.
You can embed images in a html email using a base64 encoder. Its quite complicated but you basically encode the image as a text string in the email which is then interpreted.
This does not work in all email clients though.
Take a look at this and see if its what your looking for:
http://www.campaignmonitor.com/blog/post/1761/embedding-images-in-email/
EDIT
The updated campaign monitor post on the clients which work with base64 images.
For the last part of your question, "generating a cid/contentid" I know the only way is useing outlook itself (or Word as a text editor of Outlook) to get that.
I had faced this problem when I needed to insert our company logo beside my signature text on the email.
So, open Microsoft Outlook (office 2016 im ny case) go to File > Options > Mail > Compose Messages > Signatures button
or inside the Outlook New Message windows, go Insert > Picture
If you are using html to make your whole email, you can search google for the same image, and put this in there:
<img src="http://www.google.com/intl/en_ALL/images/logos/images_logo_lg.gif" alt="picture1" />
You can also, use photobucket to host images (if you have to). Basically, you HAVE to have a source for the image.