How can I get the query from shopify app bridge resourcePicker?

How can I get the query from shopify app bridge resourcePicker?

Wakil_eFoli
Shopify Partner
45 2 4

I'm using resource picker of product type and it comes with a search box.

How can I get my hands on the data that is being passed into the search boxes query param?  

Replies 3 (3)

SBD_
Shopify Staff
1829 271 413

Hey @Wakil_eFoli 

 

It looks like it's only possible to get the selection, not the actual query.

Scott | Developer Advocate @ Shopify 

Wakil_eFoli
Shopify Partner
45 2 4

I'm using a TextField where user is going to insert a product name and when user start typing in it open a modal using resource resourcePicker(App-Bridge). Here I'm passing the input from TextField as a query to the resourcePicker. 
For example if the user is searching for "collection snowboard" then I'm passing "coll" to the resourcePicker's query and user can then complete writing the full query on that modal's search box. But when the user closes the modal the input in the TextField is still "coll". 

So how can I keep the both synchronized?

SBD_
Shopify Staff
1829 271 413

Hey @Wakil_eFoli 

 

It looks like the data can only be passed one way. There's no way to hook into the ResourcePicker state to keep it in sync.

Scott | Developer Advocate @ Shopify