cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
testaccPA
Helper III
Helper III

Update record

Hi,

 

I have to update multiple records and therefore cannot come with a single form.

 

My idea would be an update ()

Update (answers; First (filter (answers; ID = Value (LabelAWbarbeiten_1_ID.Text)));
{Answer: TextInput_Anonse1_1.Text; Question_ID: Value ('TextInput_letzeFrageID + 1'.Text);
correct: Toggle_Anonse1.Value}) ;;

then he tells me with a error;  "ID is a mandatory field"

 

ok, so i added ID, but now the error "ID is generated automatically by the server" - is that a bad joke?

 

There is a Share Point online list in the background.

 

I've been google for hours ...

 

Do you have an idea ?

1 ACCEPTED SOLUTION

Accepted Solutions
CarlosFigueira
Power Apps
Power Apps

You probably need to use the Patch function in this scenario:

Patch(
  answers;
  LookUp(answers; ID = Value (LabelAWbarbeiten_1_ID.Text));
  {
    Answer: TextInput_Anonse1_1.Text;
    Question_ID: Value ('TextInput_letzeFrageID + 1'.Text);
    correct: Toggle_Anonse1.Value
  })

The Update function is used to replace an entire record in the data source, but what you want is to change a few fields of the record, so Patch is more appropriate here.

Hope this helps!

View solution in original post

2 REPLIES 2
CarlosFigueira
Power Apps
Power Apps

You probably need to use the Patch function in this scenario:

Patch(
  answers;
  LookUp(answers; ID = Value (LabelAWbarbeiten_1_ID.Text));
  {
    Answer: TextInput_Anonse1_1.Text;
    Question_ID: Value ('TextInput_letzeFrageID + 1'.Text);
    correct: Toggle_Anonse1.Value
  })

The Update function is used to replace an entire record in the data source, but what you want is to change a few fields of the record, so Patch is more appropriate here.

Hope this helps!

View solution in original post

thanks!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (41,259)