cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lardo5150
Microsoft
Microsoft

Submit Form - Update two different SPO Lists if Field is specific Value

Now sure how to do this.

Here is my App.

When we click submit, all this information is submitted to the SPO Lists Assignments.

The time is updated with this formula:

DateValue1.SelectedDate +
Time(If(AMPMValue.Selected.Value = "PM",12,0) +Mod(Value(HourValue1.Selected.Value),12),Value(MinuteValue1.Selected.Value),
0
)

 

This is all working great.

What I would like is for the App to make the exact same update, in a different SPO list.

Engineers.LastCritAssigned

Only if the CaseType is Critical.

I dont think I can do it here, but thought maybe on the Submit button?

I would assume I would need an If statement there, but how do you make the update?

 

 

lardo5150_0-1643234173085.png

lardo5150_1-1643234205600.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@lardo5150 

So in that case, you want to lookup that record in your formula.

Example:

If(Self.LastSubmit.CaseType = "Critical",
  Patch(Engineers,
    LookUp(Engineers, somecolumninEngineers = Self.LastSubmit.AssignedTo),
    {lastcriticalassigned: Self.LastSubmit.column}
  )
)

 

By the way...pretty good from your phone!  I always have a hard time with the forum from the phone.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

6 REPLIES 6
RandyHayes
Super User
Super User

@lardo5150 

You definitely don't want to do it on the submit button...that is before the data is submitted, how would you know if it was successful?

This should be done in the OnSuccess action of your form.

Example formula would be:

If(Self.LastSubmit.CaseType = "Critical",
  Patch(Engineers,
    {column: Self.LastSubmit.column}
  )
)

This would create a new record in the Engineers list and set the column specified to the value that was last submitted.

 

I am not clear if you are attempting to create a new record or update an existing, so the above is just to create.  I'd need more information to suggest further on updating an existing.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
lardo5150
Microsoft
Microsoft

Let me see if I can do this from my phone lol.

Assignments spo list is where we log the cases.

The engineer spo list holds all our engineers data, including total count of cases, total count of critical cases, etc.

So we are UPDATING a record.

So on the submit of the edit form, we are creating a record in assignments.

So want I want to do is if the case type is critical take the same update of time you helped me with and update the engineer.lastcritassigned field for that engineer that matches the assignments.assignedto field.

Does that help?

RandyHayes
Super User
Super User

@lardo5150 

So in that case, you want to lookup that record in your formula.

Example:

If(Self.LastSubmit.CaseType = "Critical",
  Patch(Engineers,
    LookUp(Engineers, somecolumninEngineers = Self.LastSubmit.AssignedTo),
    {lastcriticalassigned: Self.LastSubmit.column}
  )
)

 

By the way...pretty good from your phone!  I always have a hard time with the forum from the phone.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
lardo5150
Microsoft
Microsoft

Ha thanks!

Ok let me try this tomorrow.

RandyHayes
Super User
Super User

@lardo5150 

Sounds good!

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
lardo5150
Microsoft
Microsoft

That was it!  THANK YOU again!!!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (1,969)