Items - identifying a linked external document

Hi,

I’m having an issue with writing code that will recognise when an attachment is uploaded using the new feature - to ‘link an external document’. This is ultimately a hyperlink rather than a document.

The template in question recognises a schedule as ‘reconciled’ when there is a document attached. My gut feeling is that hyperlinks are either not recognised under the ‘file collection’, or under the file input (.documents) hence are not recognised in this code.

{% if custom.[category].attachment_na != true %}
{% if custom.check.locked %}
{% assign sf_show_inputs = true %}
{% if custom.[category].att.document != blank %}
{% input custom.[category].att as:file_collection %}
{% endif %}
{% assign sf_show_inputs = false %}
{%else%}
{% input custom.[category].att as:file_collection %}
{% endif %}
{% endif %}
|{% if custom.[category].attachment_na or custom.[category].att.document != blank %}
{% unreconciled 0 as:indicator %}
{%else%}
{% unreconciled 1 as:indicator %}
{% endif %}

I would be grateful for any indications on where the linked document is exposed to Liquid, and what fields are reliably present for a linked item (e.g. url / id / link).

Thanks,

Mike

Hi @Mike.davis

There is indeed a limitation here since an external link is not stored in the textproperties on the reconciliation text. It’s also not considered a document so none of the regular methods (like .documents.size or document.link) work for external links. I will however raise this issue internally to see if there’s anything that we can expose in liquid going forward.

If the goal is to have the template be unreconciled when nothing is attached, I would recommend making use of the `required`attribute.

{% input custom.[category].att as:file_collection required:true %}

You can also pass a variable that is only true in certain situations, so the file input does not have to always be required.

{% assign att_is_required = false %}
{% if custom.[category].attachment_na == true %}
  {% assign att_is_required = true %}
{% endif %}
{% input custom.[category].att as:file_collection required:att_is_required %}

I hope that covers the use case you are currently looking at.

Kind regards

Romy

Hi Romy,

Thanks for confirming and for your suggestions, unfortunately the ‘required’ attribute will not work as a fix for my use case as I would still prefer the reconciled symbol displayed for each row rather than contributing to the reconciliation status of the whole template, but I have found another suitable work around.

If you are able to expose it in liquid at some point in the future that would be great, but no worries if not!

Thanks,

Mike

Hi @Mike.davis

Glad to read you found a suitable workaround.

This feature with external links has not been released to all the users of Silverfin yet, so our documentation is not live, but I do have some info on how to fetch information on external links in the meantime.

{% for link in custom.[category].att.external_links %}
  {{ link.name }} 
  {{ link.url }}
{% endfor %}

You can also check for size: custom.[category].att.external_links.size,
For your use case I would use .size on the documents and the links.

custom.[category].att.documents.size+custom.[category].att.external_links.size > 0 

KR

Romy

Hi @Romy_Vermeeren

As the documentation has been released, I just took a look at the example:

Add your attachment here: {% input custom.some.files as:file %}

{% for link in custom.some.files.external_links %}
Name: {{ link.name }}
Id: {{ link.id }}
URL: {{ link.url }}
{% endfor %}

I’m missing the clue here to add a link. If I’m not mistaken the goal is to attach a document to an external resource via a link in Silverfin, while Silverfin also ‘sees’ that the document has been attached?

In the example above I can just upload a file (as before), but not a link.

We would like to have an option where we preformat the link in certain templates so the user can upload the document directly in the external resource.

FYI: we now use links to the external resource & API calls to showcase the uploaded documents in Silverfin.

Can you give your feedback?

thanks!

Kind regards

Jelle

Hi @JelleBe

We would like to have an option where we preformat the link in certain templates so the user can upload the document directly in the external resource.

Can you elaborate a bit more here please? I don’t think what you’re asking will be possible, it works not very differently from the regular as:file input.

FYI this is what the screen looks like:

This feature has not been rolled out to all firms just yet that’s why you can’t see it.

I’ve raised the question internally when the roll out is expected, keep you posted.

KR

Romy

Hi Romy

Well the feature is related to uploading documents to a predefined url, so people can just upload the link directly in the URL we formatted and users don’t have to format it themselve, but indeed probably this is not possible.

Ah the feature is not released yet, that’s why I’m still seeing this:

Thanks!

Jelle