'siri shortcuts - get key of selected dictionary value

I have this json format of an array:

{"key_0":"myValue_0","key_1":"myValue_1"}

With this I created a dictionary, which shows me the results like this:

enter image description here

Now I would like to know the key of of the selected dictionary entry. But I have only this options:

Get:

  • value
  • all keys
  • all values

Any idea?



Solution 1:[1]

Here is how to get a key from a dictionary:

Dictionary {'gredgdsg':'fgdsdfg', 'afgfds':12313}

Get [Item] from (Dictionary:Keys)

The way this works is, when you set the Dictionary method to 'Keys', it returns it as a list. So, from there, you can use a Get Item from List block to choose a key.

Hers an image example:
you will have to click this link to view

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 loop