Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

Export/Import list of dim/measures/object #440

Open
countnazgul opened this issue Oct 5, 2019 · 5 comments
Open

Export/Import list of dim/measures/object #440

countnazgul opened this issue Oct 5, 2019 · 5 comments

Comments

@countnazgul
Copy link

Is it possible to export/import a predefined list of dim/measures/objects?

The idea is to have a list of IDs somewhere and extract their layout in json format (the output file will be used in another import operation).

I'm guessing that powershell/python/whatever script can be written that loops through the IDs list and use corectl to print the json and store the output. But was just wandering if corectl can do this for me ;)

@glooms
Copy link
Contributor

glooms commented Oct 7, 2019

Short answer: no. But, you could use the --quiet flag.
If you are using bash the following should work:

MEASURES=$(corectl measure ls -q | grep $1)
for m in $MEASURES; do
  corectl measure layout $m > "$m.json"
done

or if you prefer a oneliner:

MEASURES=$(corectl measure ls -q | grep "foo"); for m in $MEASURES; do corectl measure layout $m > "$m.json";done

Let me know if that helps @countnazgul !

@countnazgul
Copy link
Author

Yep it helps. I was planning to use something like this as a workaround :)

Need to free some time (somehow) and try and submit PR with this functionality ;)

@glooms
Copy link
Contributor

glooms commented Oct 7, 2019

Nice! Could I just ask what the use case is?

You can specify a glob pattern when you import:

corectl object set obj*.json

So you can already specify exactly which "entities" to import using glob patterns.

The only support I might see missing is that you cannot export multiple entities at once. This would simplify the scripting a bit (excluding the need the for loop above) but I'm not sure it would satisfy your use case still.

@countnazgul
Copy link
Author

Yep the import seems ok(ish) for what i have in mind.

If you want we can jump on a quick call at some point and will explain you what i have in mind as a workflow :)

@glooms
Copy link
Contributor

glooms commented Oct 8, 2019

Ye just ping us on branch slack (#qlik-core) :)

@glooms glooms removed their assignment Mar 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants