Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Set custom link name/text when creating links in original ConfiForms entry

Thomas Gjørtz March 25, 2021

I'm in need of some assistance!

I have set up a form to handle change request and every time a request is made a page is created, all thanks to the ConfiForms IFTTT Integration Rules’ Macro.

After some research I found out that it was possible to include a link to the created page in the original form. I followed the instructions on this page:

https://wiki.vertuna.com/display/CONFIFORMS/Creating+links+in+original+ConfiForms+entry+to+just+created+page 

This worked fine but there is one issue when I list all of the records in the TableView Macro, the link name, or display text if you will, has an unnecessarily long format. Please see the attached photo:

Skjermbilde 2021-03-25 231847.jpg

Is it possible to standardize the display name so that for every record it always shows "link", "weblink", "URL" or something similar?

1 answer

1 accepted

0 votes
Answer accepted
Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 25, 2021

Hi

Is the field you have for your stored link is of type "page" or html or something else?

If this contains a link (only), meaning the url, then you can use asLink virtual function (https://wiki.vertuna.com/display/CONFIFORMS/Virtual+functions ) to transform it easily

Alex

Thomas Gjørtz March 26, 2021

Hello Alex!

Thank you for answering me.

I generate the link to the created page using the field "Hidden Html". This way it's not visible in the entry form but shows up in tables/lists/calendars etc.

confiforms form field definition - hidden html.JPG

The macro that creates the link is set up as follows:

confiforms ifttt integration rules macro - onCreated.JPG

I use this parameter:

entryId=[entry.id]&link=<a href=https://confluence.intern.sparebank1.no/pages/viewpage.action?pageId=${iftttResult_0.id}>${iftttResult_0.displayTitle}</a>

 

Is it possible to use the asLink virtual function in this case? If so, can you please explain how?

Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 26, 2021

Well, not quite - is there a reason why you save back the HTML link like that? 

And not the reference to page id, for example...

 

If you insist on saving back the HTML link then just modify it the way you need (for label), For example:

entryId=[entry.id]&link=<a href=https://confluence.intern.sparebank1.no/pages/viewpage.action?pageId=${iftttResult_0.id}>Web link</a>
Thomas Gjørtz April 8, 2021

Hello Alex!


Thank you so much for your swift reply.


The parameter you suggested worked and I was able to give the link a custom name.


That being said I was curious if referencing the page ID would be a better solution.

I gave the following guide a try and my first impression is that this is a more elegant way to solve the matter.


https://wiki.vertuna.com/display/FORMS/How+to+create+pages+in+Confluence+with+ConfiForms


The problem with this method is that I'm having trouble controlling how the link text appears.


When I use this parameter:


entryId=[entry.id]&createdPage=${iftttResult_PC.id}


and then list all of the records in the TableView Macro, the link name/text appears like this:

confiforms - display text.jpg


As you can see the link is a combination of my username + the title of the newly created page.

Is it possible to modify the parameter so that I am able to set a custom link text?

Thanks in advance!

Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 8, 2021

It's possible

In the TableView you have already, instead of a ConfiForms Field with field name set to 'createdPage' put something like this

createdPage.urlPath.asLink(I am link)

into the field name parameter

This expression uses virtual functions available in ConfiForms which help you to transform the values as you need.

Alex

Like # people like this
Thomas Gjørtz April 9, 2021

Amazing!

As a token of my appreciation a case of virtuell beer is being shipped in your direction.

As we say in Norway...

Skål!

Michael Taylor September 28, 2021

Sumabeech! Been working on this for hours, since my IFTTT also creates a more complicated title than just 1 field name and asLink by itself would not work. urlPath was the missing key. Alex another virtual case your way.

Michael Taylor September 28, 2021

Now is there a way that if the page is deleted, then the record would get deleted...or vice-versa?

Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 28, 2021

This is a task for automation. ConfiForms does not listen to such events, but provides APIs to get it automated

Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 28, 2021

Of course vice versa is possible - to delete the page when the record is deleted

Just drop the IFTTT of this type  https://wiki.vertuna.com/display/CONFIFORMS/Configuring+ConfiForms+IFTTT+actions+and+rules#ConfiguringConfiFormsIFTTTactionsandrules-DeletePage to run onDeleted event in ConfiForms

Like Michael Taylor likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events