Querying NetSuite Records in Custom Form Builder Settings
In the Shopify - NetSuite IA we have a location mapping settings where
1. In NetSuite Location textbox input we get dropdown of all the NetSuite Locations we have
2. Same is with Shopify
I am using custom flows for Inventory flow and would like to have a custom setting which can mimic this. I know how to create the Key Value Pair forms via form builder, but I do not know how to get the dropdown which has all the records of certain record type from the NetSuite. In short, how can I create a custom form builder where the NetSuite side of text input will have a dropdown of all NetSuite Locations.
Thank you!
1
Comments
Hi Sujit Desai, yes this is possible and here is an example I put together for you. Note that you will need to change the connection id for each virtual export to your own Shopify and NetSuite connection ids. Also, for the NetSuite section, you will need to change the search id to your own NetSuite search id. As for the NetSuite saved search itself, my result included Internal ID that had a custom label of value and then Name with a custom label of label. Hopefully this helps!
Tyler Lamparter this is very helpful. Additionally, is there any documentation that guides how to use develop these kind of settings. This article does not comment about form fields like key resource, value resource etc. Would be great to have a generalized article that dictates how to query records from any applications in custom settings. Thanks again!
Sujit Desai it does look like the docs are missing examples and information about how to get refreshable data within them. Let me get with the doc team and see what we can do about adding in some of those advanced examples.
As for how to manipulate/use what I sent here, I typically will create an export within Celigo UI, then use our apis to make a GET request to that newly created export (you can find the export id in the url when you have that export open in the UI). Once you make the get request, copy the entire object, replace the virtual object with it, delete the id, and then you should be good to go. Note you will need a transform on it to convert the id of the response to "value" and name to "label".
Let me know if you have other questions or have another example you'd like to see in the mean time!
Sujit Desai, on another note, this refreshable setup is limited to 100 options in the drop down list. If you need something with more than 100 options, you can flip to form script and it will allow a lot more than 100 (not sure the exact limit). Here is a sample script that does the same thing as this form JSON, but allows more than 100 options per drop down. You will have to update the connection ids to your own. Again, we're working on updating documentation, but hopefully this is helpful for you and others.
On my last comment, ultimately, the script is building and returning the JSON structure below. The script just also has virtual imports and exports to get the options, then uses the returned array data to populate the keyOptions and valueOptions array fields.
Hey Tyler Lamparter this example is super helpful! I have a question though, the virtual export needs a _connectionId, I recently found out that I need to update the _connectionId when I migrate the integration from Sandbox to Production. Based on this article, https://docs.celigo.com/hc/en-us/articles/360046853572-connections-find-query- It looks like there is a way to assign an externalId on the connection, how do I do that in the UI? and is there a sample code on how to use the connections.find api? Thank you in advance!
Antonio Jr are you using JSON to build the form or using Javascript? If you're using Javascript, you could create an alias (see docs here), then reference the alias within your script to get the id of the particular environment you are in.
I'm using both, the Javascript (formInit) part is to populate the refreshable (it has more than 100 items). Can I plug that alias directly in the _connectionId part of the virtual export?
Antonio Jr it would look like this. You would just need to get the id from the options argument you are given and then pass the variable you made into the virtual export.
Here's what I did too, under the Aliases tab of the Custom Integration tile, I created an alias for the connection.
Then I updated the formInit script to use the alias
Worked beautifully! Thank you Tyler Lamparter for the direction!
Tyler Lamparter
it would be awesome if you can publish a full list of settings that can be tuned to display the records in the settings.
I am trying to select a non inventory item from NetSuite, but the dropdown only shows the first 50 records that you would see when you searched these records in netsuite.
Is there a way to see all the records in a dropdown?
Sujit Desai are you using a script? If so, what's it look like. Not really sure what you mean by “publish a full list of settings”.
Please sign in to leave a comment.