New User needing help

I am trying to create a UI that has multiple buttons (actions) for a sporting event.
When the buttons are pressed I want it to link to a database that will have the actions as columns and main column is the opposition team name.
Each button press will increase the action number by +1 in the database.

I’ve been able to create a button that will add a new row to the database but I want the buttons to increase the values of the related column on 1 row.

Hope this makes sense and someone can help.

Hi Andy,

What you need the logic to do is to update an existing object in the database. The steps to do this are:

  1. Retrieve the object you need to modify (you may already have that object on the UI side)
  2. Make the modification by updating the necessary property/column
  3. Save the object back in the database.

Hope that makes sense.

Regards,
Mark

Hi Mark,

Thanks for your reply. I am currently struggling on how to create the logic. I have been able to create a button that shows in a label the value of the required column, but I am then unable to create logic in the same button click to add an increase of +1 for each button press

1 Like

Hello @Andy_Fulton

Do you want a button click to create a row in the data table, and the next click on that button to update that row?

Regards

Hi @viktor.liablin

I have a table called Matchday_live where I want to save the data too.
For example - the data needs to go into the row for the current date and created by the current user.

Hi Andy,

The logic you shared does the following:

  1. Retrieves the first object from the Matchday_live table and stores it in the passComp property of Page Data
  2. Saves a new object in the Matchday_live table. The new object has the Pass_Comp property. That property is calculated by taking passCompNumber from Page Data and incrementing it by 1.

As you can see from the description above step 1 and step 2 are completely irrelevant to each other - what you retrieved in step 1 is not used in step 2.

This doesn’t sound like what you need to accomplish.

To assist you further, please clarify what specific object in the database needs to be modified when the button is clicked?

Mark