Redirect to URL Action with Aggregate Variable Doesn't Work?

I have a page with a model that holds a user's list of courses they're registering for, each with a price. I then have a model that uses the same data, except in the aggregate, in order to get the sum of all courses. I'm then trying to redirect to a PayPal URL and supply that total to the URL string.

What does the resulting URL look like when you try the first two options you have here?

Perhaps before resorting to using a snippet, you might be able to add a UI-only formula field to your model that outputs the desired text for the URL, and pulls in the value of the aggregate field you're after.

Hmm, I tried this with a very simple page (XML below), and was able to get the sum field's value into the URL of a template field. The Redirect to a URL seems to work on this test page too. You're right to be using triple mustaches around the field. I'd check to make sure the page component that's holding your redirect action (whether it's a button set, page title, or other action) is connected to the correct model, otherwise that field reference won't have the right context. Also, be sure that the field name you're using matches up with what's on the model, as aggregate models will rename fields to account for the kind of aggregation that's being done.

Thanks, Mark. I have been able to get it to work in a simple page (see below), so I'm doing something else wrong. However, I am noticing a separate issue that is also not helping with PayPal. If I use the aggregate variable in the URL, it formats other parts of the string as a special character, namely the &curren in &currency.

If I use the variable, it goes to:

https://www.skuid.com/test/?total=32&test=1%C2%A4cy=USD

If I hard-code the value, it goes to:

https://www.skuid.com/test/?total=123&test=1&currency=USD

If you have an active campaign with an actual cost value, you'll see the same using this page. Any ideas?

Thanks for the example XML -- I see what you mean. It looks like you need to encode the ampersand in the URL so it's handled right when using the variable. Using &amp; instead of &, and that seems to form the URL correctly. The behavior is inconsistent, as you describe, so I will bring it up with our dev team. For the present, using &amp; should work.

Thanks! And I think I found the bug. See the page below. If in a multi-action I create a new row in an unrelated model before I redirect, the total disappears. If there is no new row creation, or it happens after the redirect, the total stays. Not sure why row creation in an unrelated model affects this at all. Another bug for the team?

Seth, we have reproduced this behavior as well, and appreciate your illustration and explanation. This and the ampersand issue discussed above have both been brought to the attention of our dev team, and we will update this post when a fix is available.

This has been addressed in the new Millau 11.1.3 and Brooklyn 10.0.17 release which is now available on the Skuid Releases page.

As a reminder, Salesforce does NOT allow reverting back to prior versions of managed packages. Skuid always recommends installing new versions in a non-business critical sandbox environment to test all mission critical functionality before installing into a production environment. We also recommend that you update out of date themes when you upgrade.