Retrieve and Apply Dynamic Custom Field Inputs Using Chains
RespondidaHello! I am currently building a chain that aims to use APIs to copy a file in Wdesk, retrieve its custom field groups, custom fields, and custom field inputs and apply these to the copied version. I have been successful with copying the file, retrieving custom field groups and custom fields and applying those to the copied version. However, I have run into a blocker with applying the custom field inputs to the copied version of the file. Because this chain will run and apply the process for many files in our workspace, the custom fields and inputs will be dynamic and cannot be hardcoded into the chain.
To retrieve custom field inputs, I am using the Retrieve a Single Document API (Retrieve a single document). When using the same format of the example response, the command's output defines the custom field by its name (ex: "customFields": { "com.workiva.gsr.legal_entity": "Workiva"}. Is there a way to customize this to have some sort if identifier that I can then iterate through to make this process dynamic each time?
For instance, here is one of the outputs I received:
{"id":"xxx","revision":"xxx","name":"xxx","template":xxx,"created":{"dateTime":"xxx"},"modified":{"dateTime":"xxx"},"customFields":{"Test.DocumentDate":"xxx","Test.FileStatus":"xxx","Test.FileSummary":"xxx"},"customFieldGroups" ["Test.DocumentGroup","Test","CustomFieldExamples"],"sheetCustomFieldGroups":[],"linksStatus":{"allLinks":"published","ownLinks":"published"}}
How can i pull and apply the custom field values dynamically based on the file at hand with each chain run?
-
Hi Talia Test,
You can retrieve the value of the Document's Custom Field using the Retrieve a single document endpoint as you mentioned. The values will be included in the response body in the "customFields" object. In the new copied Document, you can add or replace (along with remove and test operations) it's Custom Field value with Update a single document PATCH request endpoint. Please keep in mind that these are prototype API endpoints at this time and are subject to frequent change and/or removal without warning.
0Iniciar sesión para dejar un comentario.
Comentarios
1 comentario