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 / Trying to update a sha...
Power Apps
Unanswered

Trying to update a sharepoint record from powerapps attachment object but will not accept variable values

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

From a Powerapps form, with an Attachment object.

 

I'm submitting the Attachment first.

SubmitForm(frm_SpaAttachment_1)

 

Then in the on success of the  "frm_SpaAttachment_1".

I'm trying to update the sharepoint record with more data.

Set(varLastID_frmSpa1, frm_SpaAttachment_1.LastSubmit.ID)
;
Set(varSqlIdedit, Value(TextInput5.Text))
;
Set(varGuidEdit, TextInput7.Text)
;
Patch(COSTSUPPORTREQUEST_SPA_ATTACHMENTS_POWERAPPS, LookUp(COSTSUPPORTREQUEST_SPA_ATTACHMENTS_POWERAPPS, ID = varLastID_frmSpa1),
{SQL_SERVER_ID: varSqlIdedit1,
CREATED_BY: User().FullName,
CREATED_DATE: Now(),
QUOTE_NUMBER: TextInput1_1.Text,
SUPPLIER_NAME: TextInput1_103.Text,
SUPPLIER_NUMBER: TextInput1_23.Text,
DIRECT_TO_CR: Dropdown1.Selected.Value,
SUPPORT_ID: varGuidEdit

}
)

;

 

ResetForm(frm_SpaAttachment_1)

 

Textinput5 and Textinput7 are holding values coming from a Datatable.(the datatable source is from sql server)

i.e.

dtbl_MyEntries_Main.Selected.CostSupportTool_id  ---- This is  Numeric value.

dtbl_MyEntries_Main.Selected.DE_GUID  ---- This is a GUID id 

 

 

Thanks

David

 

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    looking for any suggestions:  But I think i solved this problem.

    I needed to update 2 context variables on my submit button FIRST.


    UpdateContext({varSqlIdedit:Value(TextInput5.Text)})
    ;
    UpdateContext({varGuidEdit: TextInput7.Text})
    ;

     

    What was happening was i was submitting a patch statement(updating a field in the datatable) and the entry in the datatable was missing by the time i was trying to grab the data from the grid... so the variables i had on "SET"  were already gone and containing Blank Data when i was using the SET...So i used the updatecontext first before any values were erased from any objects.

  • WarrenBelz Profile Picture
    155,344 Most Valuable Professional on at

    @Anonymous ,

    Yep - two rules

    • If none of those controls are on the Form, you do not need Variables for them - just refer directly
    • If any are on the Form, you need to set Variables BEFORE you submit the Form

    Assuming only the two set are on the Form, OnSuccess can be cleaned up a bit

    Patch(
     COSTSUPPORTREQUEST_SPA_ATTACHMENTS_POWERAPPS, 
     {ID: Self.LastSubmit.ID},
     {
     SQL_SERVER_ID: varSqlIdedit,
     CREATED_BY: User().FullName,
     CREATED_DATE: Now(),
     QUOTE_NUMBER: TextInput1_1.Text,
     SUPPLIER_NAME: TextInput1_103.Text,
     SUPPLIER_NUMBER: TextInput1_23.Text,
     DIRECT_TO_CR: Dropdown1.Selected.Value,
     SUPPORT_ID: varSqlIdedit
     }
    );

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 883

#2
Valantis Profile Picture

Valantis 571

#3
11manish Profile Picture

11manish 477

Last 30 days Overall leaderboard