Copy Attachments with Services

Hello everyone, I use two forms. In one, attachments are uploaded, which I would like to get into another form via a service. I have assigned the attachments in the forms via a service, but when I run the service, I get an error message:

How can I transport an attachment from one form to another? Maybe someone has a tip for me.

Thank you very much
Vici

Leap does not allow using "Leap apps as a service" to move attachments from one form to another. It is possible to use our REST APIs to upload or move attachments.

Using our REST APIs does require a deeper understanding of coding practices, but it does make it possible.

Can you help me to understand the use case? Why are you moving an attachment from one form to another?

Hello Christopher,

thank you for your answer. I don't necessarily have to transfer the documents from one form to the other. That was my first thought, access to the file is actually sufficient. I have now solved it like this:

When uploading, I create two fields: uid and FileName. I read these in the other form via a service and transfer them to a WebLink element.

BO.F_filename.setValue(BO.F_Attachment1.getValue().fileName);
BO.F_link.setValue("/forms/secure/org/data/" + app.getUID() + "/" + form.getId() + "/attachment/" + BO.F_Attachment1.getValue().uid+"/"+BO.F_Attachment1.getValue().fileName);

In the second form, I access the fields:

page.F_StaticWebLink1.setDisplayValue(BO.F_filename.getValue());
page.F_StaticWebLink1.setLinkValue(BO.F_link.getValue());

That was it. I was thinking too complicated.

Best regards

Vici