Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Set field value on form submit

(0) ShareShare
ReportReport
Posted on by 76

I have a Sharepoint list with all of our employees.  In Power Apps, you can select an employee from the list to initiate their Offboarding.  When the name is selected (form:  NewOffboarding_1) and the form submitted, I have the following assigned to the submit buttons OnSelect:

 

Set(varNewOffboardingName, OffboardingNameSelectBox.Selected.Title);
SubmitForm(NewOffboarding_1);
ResetForm(NewOffboarding_1);
Reset(OffboardingNameSelectBox);
Set(varOffboardingVisible, false)
 
I want to also have the SP field "OffboardingStarted" (Yes/No field) updated to "Yes" for the individual selected.  How would I do that?  Would it be in the button's OnSelect property?  Or in the forms OnSuccess?
 
 
Categories:
  • StaceyGriffeth Profile Picture
    76 on at
    Re: Set field value on form submit

    Hi @BCBuizer I think I had other issues in my code.  I rebuilt the form from scratch and all is working fine now.  Thanks for your help!

  • BCBuizer Profile Picture
    22,027 Super User 2025 Season 1 on at
    Re: Set field value on form submit

    Hi @StaceyGriffeth ,

     

    Are you asking because a new record gets created instead of the expected existing one? The DefaultMode property of NewOffboarding_1 may play a role there, unless of course you are manually setting the FormMode anywhere in your app. 

  • StaceyGriffeth Profile Picture
    76 on at
    Re: Set field value on form submit

    @BCBuizer Of course!  

    StaceyGriffeth_0-1714750627724.png 

    StaceyGriffeth_1-1714750664741.png

    Is there a setting that would be causing it to create a new record, rather than updating the select (existing) record?

     

  • BCBuizer Profile Picture
    22,027 Super User 2025 Season 1 on at
    Re: Set field value on form submit

    Hi @StaceyGriffeth ,

     

    Can you please also share a screenshot, including the tree view, of the DataCard, especially the Update property? I'm starting to run out of ideas as to why this is not working as expected, so I hope that may yield some clues.

  • StaceyGriffeth Profile Picture
    76 on at
    Re: Set field value on form submit

    @BCBuizer yes, I confirmed the field is Yes/No type

    StaceyGriffeth_0-1714749887979.png

    On further investigation, it's correctly setting this field value in the SP list, however it is not setting it for the selected name, it is creating an entirely new record and setting the value on it.

  • BCBuizer Profile Picture
    22,027 Super User 2025 Season 1 on at
    Re: Set field value on form submit

    Hi @StaceyGriffeth ,

     

    The Default property doesn't play a role here, so we can leave that out of the equation. 

     

    Are you sure the column type is Yes/No and not Choice with "Yes" and "No" as possible options?

  • StaceyGriffeth Profile Picture
    76 on at
    Re: Set field value on form submit

    Hi @BCBuizer ok, I understand now.  I added that data card to the form, set it's Visible property to false, and set the Update property to true.  However, when I submitted the form, it did not update the "OffboardingStarted" field value to be "Yes".  I'm wondering if the data card's Default value should be changed?  It is currently "ThisItem.OffboardingStarted". 

  • BCBuizer Profile Picture
    22,027 Super User 2025 Season 1 on at
    Re: Set field value on form submit

    Hi @StaceyGriffeth ,

     

    Indeed, I forgot to mention to make the DataCard invisible after by setting its' Visible property to false. Like this the field gets updated upon form submission.

  • StaceyGriffeth Profile Picture
    76 on at
    Re: Set field value on form submit

    Hi @BCBuizer sorry, I'm not following.  The form is literally just the selected employee name.  But when that name is submitted, I want the other field OffboardingStarted to be set to Yes.  OffboardingStarted shouldn't actually be visible anywhere to the user.

  • Verified answer
    BCBuizer Profile Picture
    22,027 Super User 2025 Season 1 on at
    Re: Set field value on form submit

    Hi @StaceyGriffeth ,

     

    In case the OffboardingStarted should always be set to "Yes", you can just add the field to the form, remove all controls from the DataCard and then set the DataCard.Update property to true.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,660 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard