Unescape confiforms asUserLink
Asked by Myro:

Hello,

I am using Vertunas ConfiForms plugin and I want to render a user as a link. I am using ConfiForms VirtualFunctions ([Virtual Functions](https://wiki.vertuna.com/display/CONFIFORMS/Virtual+functions)) - ***asUserLink***.

The page is rendered with escaped html code of the link like this:

image2017-2-3 9:47:9.png

If it was unescaped it would be exactly what I want:

image2017-2-3 9:49:22.png

This is how the page's source looks like

```
<p class="auto-cursor-target">  <br/></p><ac:structured-macro ac:macro-id="2c1d62fa-392d-4e82-a92a-58a6bf7a47a7" ac:name="confiform-list" ac:schema-version="1">  <ac:parameter ac:name="filter">id:9a09ab10-47f0-409f-8a16-536b1d0e3776</ac:parameter>  <ac:parameter ac:name="pageTitle">    <ac:link>      <ri:page ri:content-title="testPage"/>    </ac:link>  </ac:parameter>  <ac:parameter ac:name="formName">bboard</ac:parameter>  <ac:rich-text-body>    <p>      <ac:structured-macro ac:macro-id="88976837-9c87-4752-b514-565c11ef8af8" ac:name="confiform-field" ac:schema-version="1">        <ac:parameter ac:name="fieldName">person.asUserLink</ac:parameter>      </ac:structured-macro>    </p>  </ac:rich-text-body></ac:structured-macro><p class="auto-cursor-target">  <br/></p>
```

I have tried inserting the macro into an HTML macro:

```
<ac:structured-macro ac:macro-id="56c62df5-589e-42ee-8eda-92a43702624f" ac:name="html" ac:schema-version="1">      <ac:structured-macro ac:macro-id="88976837-9c87-4752-b514-565c11ef8af8" ac:name="confiform-field" ac:schema-version="1">        <ac:parameter ac:name="fieldName">person.asUserLink</ac:parameter>      </ac:structured-macro></ac:structured-macro>
```

but it didn't work.

I was thinking about generating user id:

```
<ac:structured-macro ac:macro-id="88976837-9c87-4752-b514-565c11ef8af8" ac:name="confiform-field" ac:schema-version="1">        <ac:parameter ac:name="fieldName">person.id</ac:parameter>      </ac:structured-macro>
```

and transforming it into a link with another macro, but I don't know how to get just the value do that,

Thank you very much!  
[](https://community.atlassian.com/t5/Confluence-questions/Unescape-confiforms-asUserLink/qaq-p/40610?attachment-id=8402){#link_118f8063b1319e}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/6794/1/image2017-2-3%209%3A47%3A9.png){#display_118f8063b1319e_0}  
[](https://community.atlassian.com/t5/Confluence-questions/Unescape-confiforms-asUserLink/qaq-p/40610?attachment-id=8403){#link_118f8063b1319e_0}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/6794/2/image2017-2-3%209%3A49%3A22.png){#display_118f8063b1319e_2}


Answers:
author: Alex Medved _ConfiForms_
body: Hi Miroslav

When used inside the ListView, the appropriate function would be "asUserLinkMacro"

```
<p class="auto-cursor-target">  <br/></p><ac:structured-macro ac:macro-id="2c1d62fa-392d-4e82-a92a-58a6bf7a47a7" ac:name="confiform-list" ac:schema-version="1">  <ac:parameter ac:name="filter">id:9a09ab10-47f0-409f-8a16-536b1d0e3776</ac:parameter>  <ac:parameter ac:name="pageTitle">    <ac:link>      <ri:page ri:content-title="testPage"/>    </ac:link>  </ac:parameter>  <ac:parameter ac:name="formName">bboard</ac:parameter>  <ac:rich-text-body>    <p>      [entry.person.asUserLinkMacro]    </p>  </ac:rich-text-body></ac:structured-macro><p class="auto-cursor-target">  <br/></p>
```

comments: author: Myro
body: Thank you, it works as i've expected


author: Hanne Saels
body: I also tried to use asUserLinkMacro, but the only thing I get is one large string with all the participants (without empty spaces). I tried to use this 'rich-text-body'-thing but confluence won't accept this. Any other suggestions?

comments: author: Alex Medved _ConfiForms_
body: May be you can share the configuration you have, or better to recreate a simplified version to demonstrate the issue you are talking about?

Thanks

Alex


author: Hanne Saels
body: Hi,

Here you see the html for the trial I made. (I didn't use html to make this, but just the built in Macro.)

```
 <ac:structured-macro ac:macro-id="d93b2d67-9eac-40ec-ae57-1a55edcc46f2" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">ja</ac:parameter>
<ac:parameter ac:name="atlassian-macro-output-type">BLOCK</ac:parameter>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="f1b83a4e-6223-4117-98c2-43ea8feda9de" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="overrideFormat">asUserLink</ac:parameter>
<ac:parameter ac:name="fieldName">ja</ac:parameter>
<ac:parameter ac:name="atlassian-macro-output-type">BLOCK</ac:parameter>
</ac:structured-macro>
```

It looks like this:

*![asUserLink.png](https://community.atlassian.com/t5/image/serverpage/image-id/64249i92CC90A9705C7DE6/image-size/large?v=v2&px=999 "asUserLink.png")*

This is the configuration I used. I tried a lot of diffrent things.

*![asUserLink2.png](https://community.atlassian.com/t5/image/serverpage/image-id/64250iFE09D9879D5D4944/image-size/large?v=v2&px=999 "asUserLink2.png")*

If I try to adjust the html-code with the rich-body-text, it doesn't help.

Hopefully this is clear to you.

Greetings,

Hanne


author: Alex Medved _ConfiForms_
body: Virtual functions don't work like that and certainly it is not something to be placed in "override output format"

You just put the expression in the field name parameter in ConfiForms Field macro

```
<ac:parameter ac:name="fieldName">ja.asUserLink</ac:parameter>

![Screenshot 2019-08-26 at 22.16.48.png](https://community.atlassian.com/t5/image/serverpage/image-id/64350iF5134D7EEBA55123/image-dimensions/454x283?v=v2 "Screenshot 2019-08-26 at 22.16.48.png")
```


author: Hanne Saels
body: Thanks! Solved it!


Tags: confiforms

confluence-administration