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 / How to store a global ...
Power Apps
Answered

How to store a global variable into a form text field before submission

(0) ShareShare
ReportReport
Posted on by 45

I have an App with multiple forms and data sources. I am trying to begin the app on a home screen that asks for a project number, like so: Screen Shot 2018-10-04 at 5.42.11 PM.png

When you enter the project number and click begin, the OnSelect property calls Set(projectNumber, ProjectInput.Text);Navigate('FormOne',ScreenTransition.Fade).

 

This is correctly setting the global variable 'projectNumber' to the text input. Then once the app navigates to the next form, I am trying to set the 'Title' field so that it displays the project number and is non-editable to the user, essentially just displaying the project number at the top. I have it displaying properly by setting the 'Title' - 'DateCardValue' Default to the projectNumber global variable. 

 

The problem is when I go to submit the form using SubmitForm(FormOne), it is not submitting because 'Title' is a required field, and the form is not recognizing that this field already has a pre-filled value. Any thoughts on how I could make this work? I am going to have multiple forms that all submit to their own sharepoint list, but they should all share this projectNumber variable prior to submission.

 

 

Categories:
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @asAdmin,

    what type of data is project number in SharePoint?  Ie. lookup,choice,number or single line of text.

  • asAdmin Profile Picture
    45 on at

    Hi @Drrickryp

     

    It is just a single line of text, I was thinking of switching it to a number, but I am indifferent to either.

     

     

  • Verified answer
    tly Profile Picture
    400 on at

    One way you can do this is by having a card for the field [Title]. Let's say the datacard is dataCardFormOneTitle and its textbox's name is textFormOneTitle. Set:

    • textFormOneTitle.Default: projectNumber
    • dataCardFormOneTitle.DisplayMode: DisplayMode.View 

    Now when you submit FormOne, it will update the [Title] field with the value inside textFormOneTitle.Text, which is equal to projectNumber.

     

    Alternatively, if you don't care about displaying the project number to the end-user or have to mess around with a textbox:

    • dataCardFormOneTitle.Update: projectNumber
    • dataCardFormOneTitle.Visible: false

     

  • asAdmin Profile Picture
    45 on at

    This helped point me in the right direction, thanks! Ultimately it ended up being that I changed the DataField from "Title" to "ProjectNumber", and had changed my column name in the sharepoint list too, but after some googling apparently this field doesn't like to be changed. See screenshot for the field I'm referring to:

    Screen Shot 2018-10-08 at 7.58.00 AM.png

    So I changed the DataField value back to "Title", left the display name and the column name in my sharepoint list as Project Number and just set the Default on that DataCardValue for that Project Number data card to my global variable projectNumber. And it worked! That "Title" field might have a hidden setting or a separate place you need to update it but I couldn't find it. This solution works for me.

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 394 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

Last 30 days Overall leaderboard