Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

ConfiForms - Best & simplest way to include a hyperlink in a field?

Jeremiah Watkins
Contributor
August 31, 2023

I have a ConfiForms form with some fields. I want one of the fields to be a hyperlink, but I can't find a good way to implement it.

I can accomplish it using either a Markup or HTML field, but that would require the user to enter the information in the respective format ([text](url) / <a href="url">text</a>) and obviously this isn't very user friendly.

I tried the Link field type, but that just creates a link to a Confluence page where the page title is the text, which won't work because the text in the field won't always exactly match the title of the page, plus some instances will be a link to download a file, etc. I also tried Autolink but this seems to do the same thing, not sure what the difference is.

I tried using a Calculated field where it takes 2 other fields (entry.Label and entry.URL) and creates a Markup or HTML link. This just displays the raw text (eg: <a href="google.com">Google</a>), it doesn't turn it into a hyperlink.

I'm referencing the ConfiForms Field Types documentation and I can't find any user-friendly field type that would work.

Any help is appreciated.

1 answer

1 accepted

2 votes
Answer accepted
Alex Medved _ConfiForms_
Community Champion
August 31, 2023

Hi

Take a look at this example

http://recordit.co/GkJpIvZaq3

Complete configuration as a page storage format for easy import

<ac:structured-macro ac:macro-id="7b7551d8-5dea-48fa-be67-073154ab54a9" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">form</ac:parameter>
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="f6598ce4-fcae-41ad-87e3-bf32841ef3c1" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<ac:structured-macro ac:macro-id="85197148-af2e-43f0-87de-ed7d9f462b0e" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">link</ac:parameter>
<ac:parameter ac:name="fieldLabel">link</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="d4b63a07-82db-4c7b-9ce2-cc147d441c11" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">label</ac:parameter>
<ac:parameter ac:name="fieldLabel">label</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="04948b66-862e-4177-8661-94b6a8837231" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">autolink</ac:parameter>
<ac:parameter ac:name="fieldLabel">auto link</ac:parameter>
<ac:parameter ac:name="values">[entry.link]|[entry.label]</ac:parameter>
<ac:parameter ac:name="type">autolink</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>
<ac:structured-macro ac:macro-id="edce81c0-e605-4b74-998d-33ee620dd7a4" ac:name="confiform-card" ac:schema-version="1">
<ac:parameter ac:name="formName">form</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="6c271bd2-210d-4c13-8f82-e147f2562399" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">autolink</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="5c6f46fa-14fe-49be-8780-a06fad7b0b28" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">link.asLink([entry.label])</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>

 Hope it helps

Alex

Jeremiah Watkins
Contributor
August 31, 2023

Hi Alex,

Thanks for the help that fixed my issue. I was using:

[entry.label]|[entry.link]

But from your example it evidently should be:

[entry.link]|[entry.label]
Like Archana likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events