Need Help with Updating Entries of a Form

i have some specific logic I want to implement so I want to be able to update an entry column value based on entry id and change it from the frontend, so that if a user clicks on a button or makes an action, the value of the status column is changed to 1, lets say it was 0, so what I want to do is filter the count of the entries by the status so that I can get the total number of entries with a status of 1

Thanks

Hello Takudzwa!!

What you are looking to do is possible with some custom PHP code. Here are a couple of tips for you to get this done.

1- Add a text field to your form with the “visibility” property (under the advanced tab) set to “Administrative”. This will allow you to change the value of this field and it will be saved as part of the entry. Since the visibility is set to “Administrative”, it won’t be displayed on the front end of your form.

2- When the button is clicked to update the status, you will want to use GFAPI::update_entry() to update the entry. Pass the entry parameter to this method with “1” for your administrative field.

3- To filter the entries by your new administrative field, you can use GFAPI::get_entries(). I hope this helps pointing you in the right direction

Cheers!
Alex

2 Likes

Thank you so much for the help, i was able to find a work around to that problem i ended up using wp admin frontend and passed the page to the frontend so users can just update from there,

So now i have this problem i want to filter form entries using a shortcode with formid, filter field then the filter value, im using {user:user_email} for the filter value but the shortcode is not working, when i do this in the view filtering options its filtering but on the shortcode its not working, if there is a way to do tha please help me

Hi @chikangatakudzwa ,

If you are having problems with a GravityView View, please contact us at https://www.gravitykit.com/support/, and we’ll help you with that.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.