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 / My submit button doesn...
Power Apps
Unanswered

My submit button doesn't switch to edit mode when populated with data from a global variable. How do I fix?

(0) ShareShare
ReportReport
Posted on by 831 Moderator

I have a form with several required fields. The submit button uses the following code

 

If(FRM_CampaignForm.Valid, DisplayMode.Edit,DisplayMode.Disabled)

 

This works fine. My problem is when I fill in the fields using a copied record stored in a global variable. I set the "Item" property of the form to the global variable. This fills in all the fields as expected including all of the required fields. However, the submit button doesn't shift into Edit mode. Why is this an how do I fix it?

Categories:
I have the same question (0)
  • kelseytran Profile Picture
    292 on at

    Hi @futr_vision ,

    To make sure the form validation is triggered and the submit button updates its state, you can force the form to revalidate itself after setting the item property.

    1. Create a global variable:

    Set(glbCopiedRecord, LookUp(SourceTable, ID = SelectedRecordID));

    2. Set the form item property:

    Item: glbCopiedRecord

    3. Force revalidation:

    Set(glbCopiedRecord, LookUp(SourceTable, ID = SelectedRecordID));
    UpdateContext({varRevalidate: Now()});

    4. Trigger validation

    UpdateContext({varRevalidate: Now()});

    5. Modify the Submit Button code:

    If(
     FRM_CampaignForm.Valid && !IsBlank(glbCopiedRecord),
     DisplayMode.Edit,
     DisplayMode.Disabled
    )

    6. Make sure all the fields are validated

    ForAll(
     ControlsOf(FRM_CampaignForm),
     Reset(ThisItem)
    );

    ------------------------------------------------------------------------------------------------------------------------------
    If I answered your question, please accept my post as a solution and if you liked my response, please give it a thumbs up.

    Thanks!

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard