REST model with only insert method does not accept url params?

  • 1
  • Problem
  • Updated 3 years ago
  • Acknowledged
Model url setup (clearly, a url merge param exists, right?)


But...


What's going on here?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Looks like a bug with the Page Composer for REST Models with only an Insert method. As a workaround, this should work if you specify the URL Merge Condition's parameter name in the XML for the URL Merge Condition.

1. Open the page xml editor and find your Model's <model> node.
2. Find the <condition> node, and set the sourceparamattribute to the name of the merge parameter in your URL

For instance here's what the Condition node might look like, where I've got a url /createcontact?email={{emailaddress}} 

<condition type="fieldvalue" value="joe@gmail.com" enclosevalueinquotes="true" sourcetype="param" sourceparam="emailaddress"/>
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Thanks, Zach.

For others not as comfortable with editing XML, you can trick the builder by adding a query method with the same url merge condition parameter. Once you've set up your condition, you can delete the query method, and the condition will stay.