{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":4249,"path":"build-workflows/workflow-studio/lookup-attachment-flow-designer.md","title":"Look Up Attachment action","bundle":null,"doc_type":null,"release":"australia","body":"\n# Look Up Attachment action\n\nLooks up an attachment associated with a record and returns the Attachment Sys ID as a data pill.\n\n## Roles and availability\n\nAvailable as a Workflow Studio ServiceNow core action. Users with the flow\\_designer or admin role can add an action to a flow and define configuration details.\n\n## Inputs\n\nProvide a value for each input that your flow needs. To add dynamic values, you can also drag and drop pills from the Data panel or select them from the pill picker.\n\n-   **File Name**\n\n    Data type: **String**\n\n    The name of the attachment that you want to look up. You can leave this input empty to look up all attachments for a record.\n\n-   **Source Record**\n\n    Data type: **Record**\n\n    Record containing one or more attachments to look up. You can use the [Look Up Record action](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/build-workflows/workflow-studio/lookup-record-flow-designer.md) to find an appropriate source record.\n\n\n## Outputs\n\nThese outputs appear in the Data panel. You can use them as inputs elsewhere in your flow.\n\n-   **Attachment Sys ID**\n\n    Data type: **String**\n\n    Sys ID of the first matching attachment. You can use the [Look Up Record action](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/build-workflows/workflow-studio/lookup-record-flow-designer.md) to convert this string value into a record output.\n\n-   **Attachment List**\n\n    Data type: **String**\n\n    JSON formatted string containing all attachments that match the look up query. Each matching item is formatted as an object containing the Sys ID, the file name, and the file size in bytes of the attachment. You can use a custom action to parse this object as needed.\n\n\n## Look up attachments from incident records\n\n\\[Omitted image \"example-look-up-attachment-action.png\"\\] Alt text: Configuration of the Look Up Attachment action where the File Name input is empty, and the Source Record is mapped to the trigger incident.\n\nThis example looks up attachment from incident records so that they can be copied to related problem records. The File Name input is empty to find all attachments in the source record. The Source Record input uses the incident trigger record data pill.\n\n\\[Omitted image \"example-look-up-attachment-action-execution-details.png\"\\] Alt text: Execution details for flow step 1 showing a specific Sys ID string returned as output.\n\nIn this example, the flow execution details show that the trigger incident had only one attachment. The Attachment Sys ID output lists the Sys ID of the attachment record as a string value. The Attachment List output is empty because there was only one attachment associated with the source record.\n\nWhen the triggering incident record has two or more attachments matching the look up query, the action populates the Attachment List output with a JSON string.\n\n```\n[\n  {\n    \"sys_id\": \"a8008849db7e4210497c1a481396193c\",\n    \"file_name\": \"Root Cause Analysis\",\n    \"file_size_in_bytes\": \"48955\"\n  },\n  {\n    \"sys_id\": \"c0a298356f102100758ecb512e3ee409\",\n    \"file_name\": \"Pasted Image\",\n    \"file_size_in_bytes\": \"97236\"\n  }\n]\n```\n\n**Parent Topic:**[Workflow Studio actions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/build-workflows/workflow-studio/flow-actions.md)\n\n"}}