Is there any easy way to copy variables into clipboard?

i'm trying to copy some jsons that my output query to clipboard without adding a transformer, just for debug purposes, also if i do console.log - it doesn't copy the output if i highlight it and copy..

For example -
image

here's a state parameter,
if i try to copy it
image

not everything is copied and i just really want the json of it to debug it externally

are_all_repos_selected 
""
centralized_repo_name 
""
created_at 
"2022-10-19T09:13:29.751029"
creator 
undefined
installation_id 
undefined
is_active 
false
name 
undefined
owner 
undefined
status 
"pending"
status_code 
""
vendor 
"aws"

Hey @Ariel_Beck !

Here's a detailed guide to help you achieve copying JSON data to the clipboard for debugging purposes:

  1. Create the Inline Data Source
  • Create a new JavaScript query and name it arrayOfData.
  • I used the following code to create your mock data array:
return [
  {
    are_all_repos_selected: "",
    centralized_repo_name: "",
    created_at: "2022-10-19T09:13:29.751029",
    creator: undefined,
    installation_id: undefined,
    is_active: false,
    name: undefined,
    owner: undefined,
    status: "pending",
    status_code: "",
    vendor: "aws"
  },
  {
    are_all_repos_selected: "",
    centralized_repo_name: "",
    created_at: "2022-10-19T09:13:29.751029",
    creator: undefined,
    installation_id: undefined,
    is_active: false,
    name: undefined,
    owner: undefined,
    status: "pending",
    status_code: "",
    vendor: "aws"
  },
  {
    are_all_repos_selected: "",
    centralized_repo_name: "",
    created_at: "2022-10-19T09:13:29.751029",
    creator: undefined,
    installation_id: undefined,
    is_active: false,
    name: undefined,
    owner: undefined,
    status: "pending",
    status_code: "",
    vendor: "aws"
  }
];

  1. Display the Data
  • Created a text component.
  • Set its Value to:
{{ JSON.stringify(arrayOfData.data, null, 2) }}

This ensures the JSON data is formatted as a string for easy viewing and copying

  1. Add a Button for Copying Data
  • Set the button's Action to "Copy to clipboard".
  • In the Value field, enter:
{{ text1.value }}

image

chrome-capture-2024-7-5

I hope this helps!

1 Like