Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Sort Category Fields in mapping app
- prompt "App ID" $appId
- prompt "Field ID" $fieldId
- $app = podio_app_get_raw($appId)
- $save = {}
- foreach ( $app.fields as $field ) {
- if ( $field.type != "category" ) continue
- if ( $field.field_id != $fieldId && $field.external_id != $fieldId ) continue
- opts = array_sort_pf($field.config.settings.options, "text", true)
- opts = array_values(opts)
- $field.config.settings.options = opts
- $url = "/app/" + $appId + "/field/" + $field.field_id
- podio_raw_curl($url, "PUT", {}, $field.config)
- }
- print "done"
Add Comment
Please, Sign In to add comment