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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

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

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?

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>

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!

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

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!

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.

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

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

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
Community showcase
Published in Confluence

Confluence Mythbusters: Does Atlassian even use Confluence?

Hi, Confluence collaborators! As part of #Confluence-Collaboratory month, we’ve created a very special Mythsbusters segment, where we're dive into an interesting myth and uncover the truth behind i...

1,463 views 7 29
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you