How to read the comment that the artist added in ui while publishing

context.data[“comment”] = “”
this creates a comment box in the UI
but how to get the value of it after the artist changes it ? to add it as a description for the file published on SG .

Welcome to the forums @ELhamAmer :partying_face:

You can get the value from that same variable; whatever the user puts in the UI, it’ll replace that empty string you created.

print(context.data["comment"])

Thanks @marcus
when exactly this print should be ,I mean the creation of the UI box is done in the collector
but the value will be required at the integrator where it creates a shotgrid entry
and the integrator doesn’t have context
even if trying to print at the end of the collector it returns empty string since the artist didn’t edit it yet

The "context" member should update as the user is typing, for every character being pressed on the keyboard.

You can try and put a print-statement here to verify this.

@marcus
I still didn’t get how to use it in the integrator, which is an instance plugin?

the scenario as follows:
the comment box is in the collector plugin and it is shown in the UI after the collector plugin is executed
then the artist should type his comment
then the extractor ,integrator plugins get executed
we need the comment here to be added in the step for publishing to SG as a description for the file publish
so again the value that the artist added should be stored some where accessible from the InstancePlugin instances

Within the process method of you InstancePlugin you should be able to access it via the instance argument that gets passed in: instance.context.data['comment']

1 Like

thanks a lot ,this did the trick