web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch - Error handling..
Power Apps
Unanswered

Patch - Error handling..

(0) ShareShare
ReportReport
Posted on by 356

Hi Guys,

 

Quite a complex scenario but i know the Experts here will be able to point me in the right direction.

Scenario : I have 2 SP lists. 1 List has around 1500 entries which i am using as a lookup for the 2nd list. The actual app is PATCHING data to a second list.

 

I am also trying to use  @RezaDorrani "Save as Draft" functionality for the solution. Initiually i was given an error on submission that data was missing but now nothing happens. The button presses but no error , i just stay on screen. 

 

To note: i copy a lot of content from all over to make the app , my own technical knowledge is limited. Here below the patch formula i am using right now. the "LocIsSubmit vairable is from Reza's YT video sugestion. for submitting DRAFT info.

 

UpdateContext({locIsSubmit:true});Patch('Vandalism and Insurance_1',Defaults('Vandalism and Insurance_1'),{'5G Site Name':DataCardValue3.Text,Region:DataCardValue8.Text,'Date Discovered':DataCardValue13.SelectedDate,'Reason For Site Visit':DataCardValue11.SelectedItems,'Vandalism Description':DataCardValue6.SelectedItems,'EMS (NetEco/U2020) Alarms Reported':DataCardValue2.Text,'No of Batteries stolen?':DataCardValue5.Selected.Value,'Police Case Status':DataCardValue7.Selected,'SAPS Case No:':DataCardValue9.Text})

 

btw: Submit as Draft does populate the record in the 2nd SP List.

 

I hope this makes ANY sense at all... More than happy to provide ANY further information.

Thanks so much in advance!

Categories:
I have the same question (0)
  • LuizVicente Profile Picture
    984 Super User 2024 Season 1 on at

    I didn't quite understand what the problem could be.

     


    I am also trying to use  @RezaDorrani "Save as Draft" functionality for the solution. Initiually i was given an error on submission that data was missing but now nothing happens. The button presses but no error , i just stay on screen. 

     


    Do you want to exit form screen after saving data?
    If so, there are two ways:

    // If there is a previous screen (same as browser page history), use this function:
    Back(ScreenTransition.Cover); //The transition effect
    
    // or...
    Navigate(Screen,ScreenTransition.CoverRight)

     

  • Lasherza Profile Picture
    356 on at

    Hey! Thanks for helping me the last few days. Really appreciate man. Im trying to get my knowledge up all the time and forums like this do help. I don't really have the time to learn full time so i kinda need the extra help :-).

     

    So ill tell you my scenario what I'm trying to achieve but its kinda difficult to explain but i will try.. maybe there's a better way what I've been trying. So ....

    I have one SP list with around 1500 site names and other information. I do not want EDIT those records but CREATE new records ...Somewhere either on this list or somewhere else.....( this is my dilemma)  , i want to use those Site names in SP1 to populate a NEW list or Same List ( and Only show the newly created records...). I thought of using PATCH which does work to a new SP List.

     

    I also want to create the records over time such by submitting some information that becomes available ..This is where i saw @RezaDorrani you Tube video about using a Submit as Draft button which submits data to the new record using a local variable which turns fields into REQUIRED fields on the button this changes the status to DRAFT.. Then when all data is ready the SUBMIT button adds the MISSING data.. 

     

    The way he acheived the DRAFT/ SUBMIT feature was with this line of code.

    UpdateContext({locIsSubmit:false}) on th DRAFT button and 

    UpdateContext({locIsSubmit:true}) on the SUBMIT button

     

    All the fields in the new (patched) SP List are set Not required (data target), but set as below on the App.

    This still patches though when Submit is pressed even though it is set as below... ( True )

    I do notice though the required asterisks show when SUBMIT is pressed but again it still patches..

    Lasherza_0-1661156872135.png

     

    Thanks. Hope it makes sense.. lol.

     

     

    Sorry tough to explain without showing i guess. But this is what im trying to do.

     

    The other aspect is i wanted to

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 491

#2
WarrenBelz Profile Picture

WarrenBelz 407 Most Valuable Professional

#3
11manish Profile Picture

11manish 331

Last 30 days Overall leaderboard