C3 Data Convert Example

4

Index

Stats

3,098 visits, 6,463 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 27 Dec, 2023. Last updated 11 Sep, 2024

1D Array

There is an json.

{
	"name": "Fruit",
	"items": [
		"Apple",
		"Banana",
		"Cherry",
		"Strawberry",
		"Mango",
		"Kiwi"
	]
}

you want to store the data of items in the Array Object.

{"is-c3-clipboard-data":true,"type":"events","items":[{"functionName":"TransferArray","functionDescription":"","functionCategory":"","functionReturnType":"none","functionCopyPicked":false,"functionIsAsync":false,"functionParameters":[{"name":"path","type":"string","initialValue":"","comment":""}],"eventType":"function-block","conditions":[],"actions":[{"id":"set-size","objectClass":"Array","parameters":{"width":"0","height":"1","depth":"1"}}],"children":[{"eventType":"block","conditions":[{"id":"repeat","objectClass":"System","parameters":{"count":"JSON.ArraySize(path)"}}],"actions":[{"id":"push","objectClass":"Array","parameters":{"where":"back","value":"JSON.Get(path & \".\" & loopindex)","axis":"x"}}]}]}]}

Use: TransferArray("items")

2D Array

There is an json.

.

  • 0 Comments

Want to leave a comment? Login or Register an account!