Is there any easy way to copy variables into clipboard?

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!

2 Likes