sindresorhus / Actions

⚙️ Supercharge your shortcuts
https://sindresorhus.com/actions
2.65k stars 115 forks source link

Keys parameter list disappears in Generate CSV action #93

Closed BitRancher closed 1 year ago

BitRancher commented 1 year ago

Summary: When supplying a List magic variable as the Keys option for the Generate CSV action, the magic variable disappears from the Keys field after closing the shortcut in the shortcut editor. However, the Generate CSV action continues to execute as expected.

I am using Generate CSV to create a text variable that I will copy to the clipboard. Rather than hard-code the columns to be generated, I am creating a List of column names that the user can modify as needed. Here is a description of what I've found:

  1. The first case parses a simple text file into a List of Dictionaries and then uses Generate CSV to produce a text file with all columns included (the default case).
  2. The second case adds a List of column names which are supplied as a magic variable to the Keys option of the Generate CSV action. As expected only the two specified columns (Age and ID) are included in the output.

Then, I close the editing window for that simple shortcut.

  1. The third case shows what I see when I re-open the simple shortcut. The Keys field of the Generate CSV action is now empty -- the magic variable is gone. But when I run this shortcut, the output (as shown) includes only the two columns I specified in the List.
  2. The final case shows that I can change the List (first action) to get different columns and it works as expected.

So, although the Generate CSV action is working correctly, the magic variable disappears from the Keys option field. This makes it difficult for a reader to understand what is going on or to edit this action at some point.

Note: Please keep this magic variable functionality. It's great to be able to dynamically control the columns in the CSV.

thank you.

1 - Generate CSV all colums 2 - Generate CSV selected columns 3 - Generate CSV after close   reopen 4 - Generate CSV with new Keys list

Actions 2.2.0 (35) - com.sindresorhus.Actions macOS 13.1.0 MacBookPro18,3

sindresorhus commented 1 year ago

This is unfortunately a bug in Shortcuts, not Actions. You will have to report this to Apple instead. Actions provide the logic when an action is executed and it tells the system what it accepts, but in the end, it's the Shortcuts app that decides how it's all presented, so any interface bugs needs to be fixed in the Shortcuts app.

BitRancher commented 1 year ago

Thanks for your quick response. I submitted it as FB11927996.

On Dec 28, 2022, at 5:09 PM, Sindre Sorhus @.***> wrote:

This is unfortunately a bug in Shortcuts, not Actions. You will have to report this to Apple instead. Actions provide the logic when an action is executed and it tells the system what it accepts, but in the end, it's the Shortcuts app that decides how it's all presented, so any interface bugs needs to be fixed in the Shortcuts app.

— Reply to this email directly, view it on GitHub https://github.com/sindresorhus/Actions/issues/93#issuecomment-1366953567, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHRCDB2C7GZWIS63I33DV7TWPS3B3ANCNFSM6AAAAAATLQNN2I. You are receiving this because you authored the thread.