Setting Up a Drawer with URL based REST API

  • 1
  • Question
  • Updated 1 year ago
  • Answered
I'm am shifting from Skuid for Salesforce to Skuid Platform as I'm another bailing on the SF back end. I'm accessing data using REST API - mostly from Zoho and we've made great progress. I just want to use drawers here like I've used them in SF but some of the methodology is different. For example, conditions in the Model field are now URL Merge Conditions but they only allow a merge from the primary ID. How do I set this up so that when I create a drawer, I see the records in contacts related to the Accounts where Account_name.id in Contacts = AccountID in Accounts?
Photo of jdbuerger

jdbuerger

  • 502 Points 500 badge 2x thumb

Posted 1 year ago

  • 1
Photo of Amy Dewaal

Amy Dewaal, Official Rep

  • 8,200 Points 5k badge 2x thumb
John,

I think you should be able to get this to work. You can actually set any conditions on your REST model that the REST API allows you to. For example, let's say that I have a table of Accounts with their billing country codes, and I want to get the name of the country to show in a drawer (an admittedly contrived example, but it somewhat parallels your use case). I can use a REST connection to https://restcountries.eu/ to look up the name of a country based on it's two letter code. To do that, I added a DrawerCountry model, and it's Data Source URL is /rest/v2/alpha/{{code}}. Because I've added {{code}} to the URL, I can then go to the URL Merge Conditions section of that model, hit the plus, and then select code to add a filterable condition on it. The URL Merge Parameters only show as options what you've put in the URL. I then added a drawer action to my table, and added two actions to the before load actions of the drawer - activate and set value of model condition (set the {{code}} parameter to {{BillingCountry}}) and then queried the DrawerCountry model (query behavior is get more - merge in new rows with old). In your situation, you'll need to check that Zoho allows you to pull results back based on your criteria, but if it does you should be good to go. Let me know if any of that was unclear or if you run into problems.