• Resolved jhpacker

    (@jhpacker)


    Hi,
    I’m trying to create fields based on outputting their JSON, editing that, and then using “field create” to make similar, but slightly different version of the original field.

    My problem is that the –field-json flag does not seem to do anything. For example:

    wp gf field get 29 9 > field_9.json
    wp gf field create 29 select testlabel --field-json=field_9.json

    I’d expect that to duplicate field 9, but it creates a blank select field with the label “testlabel”, but none of the description & settings from the field 9 JSON file. The JSON file itself looks fine with the contents I’d expect.

    Additionally, shouldn’t type and label not be required fields when pulling from a JSON file which already contains that content?

    Thanks,
    Jason

Viewing 1 replies (of 1 total)
  • Thread Starter jhpacker

    (@jhpacker)

    The answer (thanks GF support!) is that the field-json needs to be a JSON string and not a file. When you specify it as a string it also doesn’t require the type & label to be required, so everything works then as expected.

Viewing 1 replies (of 1 total)
  • The topic ‘Field create from JSON’ is closed to new replies.