How to access the response data of a query and pass those as query parameters to a new page

  • Goal:
    I want to execute a query that creates a record, returns an ID. I want to immediately trigger a switch to a new page with that ID in the query string.

  • Steps:
    I added a button to my form. The button has a script as its on-click event:

create_new_data_element.trigger({
additionalScope: {},
onSuccess: function (data) {
utils.openPage("data_element_details",{"passDataWith":"urlParams",queryParams: {"id": data.newDataElement.id }, hashParams: {}, globalVariable:{}, setInOrSetValue: "Set in", keyPath: null, globalVariableValue: null, persistUrlParams: false, newTab: false});
console.log("yay3");
},
onFailure: function (error) {
},
});

But the ID keeps coming as undefined.
when I print the ID it show sup in the console, so I'm correctly accesssing it. The issue is somehow passing query parameters is not working.

Hi @bbeasleyAtZscaler,

Thanks for reaching out! Sorry to hear that you ran into this. It looks like you may have solved this here? :crossed_fingers: