I need help on how to pass productid and quantity from data store to server action

Hi fellow Wapplers,

Could someone please guide me on how to send the productid and quantity to a server action? Get the values from data store to server action.

Tnx!

Need more info. Platform node/ Php/ ASP/ .Net ?

This projekt is in PHP.

When you call the server action, either use GET vars and put the datastore fields in the server action fields or use POST and populate the form vars with the datastore fields.

Have you read this

Hi,
Yes, I’m able to get it to work with POST variables. Any idea on how to do it with GET variables?

Thank you.

Easy enough to submit automatically by adding form submit() on page load. Get may have some security issues. Also see my post on PayPal IPN (php) which gives you the submit code and also how to verify the page caller to prevent hijacking.

Also see this thread

I went the route with POST variables. My quest for getting it to work with GET is continuing.

Thanks for the input.

I doubt it can be reliably achieved solely due to the limitation of characters which can be placed a GET parameter, typically 2,048 character. A POST variable can pass an array, to do it by GET you would need to split the datastore into its constituent parts and pass them individually or as something like a comma separated lost. It would also be very vulnerable to injection

1 Like

A new “Form Data” component was added to the latest Wappler version and it makes sending complex data structures to the server side really easy: