How to write a url in an email created by an IFTTT macro?
Asked by Jonathan Vorndamme:

I would like to be able to send an email via IFTTT that contains a url, but I'm not able to do so, because it is directly converted to a link. I would like to keep the url as plain text, is there a way to achieve this?  
The background is that I try to create rest api link allowing me to update the entry that was causing the email and therefore I need to use \[etrny.id\] and other replacement which obviously cannot work at the time I edit the form. I was trying to put the url into a different field, but as it contains ampersands that does not seem to be possible either.


Answers:
author: Alex Medved _ConfiForms_
body: Best option is to use HTML macro to create a HTML link

Especially if you want to have a dynamically created web link

comments: author: Jonathan Vorndamme
body: Thanks for your answer, that seems like the perfect solution. But I'm not able to find the HTML macro, unfortunately. Where is it?


author: Jonathan Vorndamme
body: Is it possible that my organisation disabled it?


author: Alex Medved _ConfiForms_
body: May be... hard to guess - <https://confluence.atlassian.com/doc/html-macro-38273085.html>


author: Jonathan Vorndamme
body: Our Admins are very cautious, so I'm pretty sure they didn't enable it. Is there another option? I currently set the url to a field using % instead of \& and change that back using replaceWith virtual function, but a direct method to achieve this would be very nice. E.g. if it was possible to use a virtual function on text that is not in a field.


author: Alex Medved _ConfiForms_
body: May be the best option then would be to set up an autolink field


author: Jonathan Vorndamme
body: Thanks, works perfectly for new entries. Old entries can be updated the following way using an IFTTT macro: set link using % (or any other unused sign/string) instead of \& and set it to itself replacing % with \& afterwards (can be done in one ifttt).


author: Alex Medved _ConfiForms_
body: Can also be triggered via <https://wiki.vertuna.com/display/CONFIFORMS/ConfiForms+Server+REST+API+version+1#ConfiFormsServerRESTAPIversion1-UpdateConfiFormsFieldvaluebyfilter>

to force recalculation of the auto-links and formulas


author: Jonathan Vorndamme
body: That's great, could you provide me with an example of the command (curl if possible)/url to do this? Documentation is a bit sparse on this side.


author: Alex Medved _ConfiForms_
body: curl to make a PUT on /rest/confiforms/1.0/updateFieldValue/{pageId}/{formName} ?

What is "sparse in the documentation"!?


author: Jonathan Vorndamme
body: Yes, exactly. I would like to once see a full command including everything that I need to call the API. The documentation seems to assume that I am very familier with http request (which I'm not) so it's very hard for me to deduce the exact syntax and components needed to generate one successfully. A full example command for each API-endpoint would be very helpful, at least for me.


author: Alex Medved _ConfiForms_
body: Honestly, this is too much to expect - really if you are looking on how to use curl then head to "curl" documentation...

ConfiForms specific details are provided in our docs


author: Jonathan Vorndamme
body: Ok, so let's stay confiforms specific: If I want to set multiple fields at once how would I do that? Comma seperated list? Also, are the formulars and autolinks recalculated without specifying them in the request?


author: Alex Medved _ConfiForms_
body: This specific method is about updating ONE field... not multiple... it is also called -"Update ConfiForms Field value by filter"

"no comma separated list"...

There is absolutely no need to specify formulas or auto-link fields - these are calculated for you on record create/update


author: Jonathan Vorndamme
body: Sorry, I missed the difference between "update entry" and "update field value". While formulars are being updated when the related fields change, I cannot observe the same for auto-links, so I have to update them explicitly using e.g. REST-API, right?


author: Jonathan Vorndamme
body: If I try that using command  

curl -H "Authorization: Bearer \<PAT Token\>" -X PUT \<our-url\>/rest/confiforms/1.0/updateFieldValue/\<pageID\>/\<FormName\> -d "fv=\<filedname\>:test"

I get the following error message:

{"result":"Backend exception. Caused by Cannot read the array length because \\"fieldAndValues\\" is null"}

Do you have an idea, what's wrong with the command?


author: Alex Medved _ConfiForms_
body: Not sure where that comes from, but the URL to call according to the documentation is

```
/rest/confiforms/1.0/updateFieldValue/{pageId}/{formName}?fv={fieldName}:{fieldValue}
```

Setting the values for {pageId}, {formName}, {fieldName} and {fieldValue}


author: Jonathan Vorndamme
body: Ok, apparently this works:

curl -H "Authorization: Bearer \<PAT Token\>" -X PUT \<our-url\>/rest/confiforms/1.0/updateFieldValue/\<pageID\>/\<FormName\>?fv=\<MyField\>:\<MyValue\> -d ""  

without any data (the conent doesn't actually matter), the request is rejected. I must admit that now that I know how it works, I can see how I was supposed to read that from the documentation, but it's a bit unintuitive that a PUT is used to put nothing and instead submit the content as a query parameter. Couldn't that confusion have been avoided by just using a GET instead?

What is also confusing is that the first entry to the table in the documentation states what you need to POST in the column of query parameters which kind of hides that we are talking about query parameters in that column.

I'd like to suggest to add an additional column to the table describing the PUT/POST Parameters and in the heading of the query parameters column add something like "set as \<REST-API-url\>?\<param1\>=\<value1\>\&\<param2\>=\<value2\>...".


author: Jonathan Vorndamme
body: Thanks for your reply, I just saw it. The reason for the error is that the parameter fv is not set because I tried to set it as PUT data instead of a query parameter.


Tags: confiforms

confluence-server

server