keys

The keys task accepts an object that contains key/value pairs and returns an array that contains the key field information only, in the same order as it was presented by the original object. JSON formatted content is an object, and therefore a highly suited use case.

Potential use case

Use this task if you need to build a form that displays key names of an object as labels on the form.

Properties

IncomingTypeDescription
objObjectRequired. The object from which the key names should be converted to an array.
OutgoingTypeDescription
keysArrayThe key names found within the obj variable.

Example

In this example, the obj value is statically set to:

1{
2 "success": true,
3 "deck_id": "bybjeupe9ymb",
4 "remaining": 52,
5 "shuffled": true
6}
keys (object) task with static obj input

This sample content was obtained via the GET/restCall task applied to the Deck of Cards API.

The outgoing keys value will be an array with the following contents:

1[
2 "success",
3 "deck_id",
4 "remaining",
5 "shuffled"
6]