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 / TextInput in DataCard ...
Power Apps
Answered

TextInput in DataCard Not Saving to SharePoint List

(0) ShareShare
ReportReport
Posted on by 299

Hello All!

I'm building a form with drop-down controls converted to a gallery with checkboxes.
Those two controls are SharePoint Choice columns and both columns have the 'Checkboxes' & 'allow Fill-in choices' options selected: ChangeType and ChangeReason.

  • The gallery placed in the ChangeType datacard is ChangeTypeCKBoxes. The Checkbox added to the gallery has the following statement on the OnCheck property: Collect(colChangeType,ThisItem); and a statement on the OnUnCheck property: Remove(colChangeType,ThisItem).
  • The Checkbox Default property: ThisItem.Value in colChangeType.Value
  • The ChangeType datacard has the following statement in the Default & Update properties: colChangeType.
  • The ChangeReason datacard has similar properties/functions.
  • Both Choice columns have an 'Other' checkbox option.
  • I added a corresponding SingleText column for the 'Other' checkbox options: ChangeTypeOther and ChangeReasonOther.
  • I pasted a TextInput control, for the SingleText columns, into the drop-down control DataCards and renamed them, txtChangeTypeOther and txtChangeReasonOther.
  • I set the Default property for the txtChangeTypeOther to ThisItem.ChangeTypeOther.
  • I set the Default property for the txtChangeReasonOther to ThisItem.ChangeReasonOther.

The checkboxes are functioning as expected, however the fields for the 'Other' data do not save back to the SharePoint list when I submit the form. I've tried to Patch the 'Other' fields, but cannot get the Patch statement correct: Patch(TestPayroll, LookUp(TestPayroll, {ChangeTypeOther: txtChangeTypeOther.Text, ChangeReasonOther: txtChangeReasonOther.Text})); Screenshots attached.

Thank you for any assistance!

Patti

payrollChange1.png
payrollChange3.png
payrollChange2.png
Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @PVLove 

    If this is in a Form, then there is no need for any Patch functions.

    What is the Items property of your Gallery?

     

    "I added a corresponding SingleText column for the 'Other' checkbox options: ChangeTypeOther and ChangeReasonOther."

    In the above you mention that your column allows write-ins, but you seem to be then storing the write-in in another column in your data source all together - is there a reason for that?

     

  • PVLove Profile Picture
    299 on at

    Hi @RandyHayes ,

    Thank you for the super quick reply!!

     

    The Items for each 'Checkbox' gallery is the corresponding Item for the SharePoint Choice column.

    Gallery: ChangeTypeCKBoxes > Items > Choices([@TestPayroll].ChangeType)

    Gallery: ChangeReasonCKBoxes > Items > Choices([@TestPayroll].ChangeReason)

     

    I'm trying to store the information entered in the Text Input fields for the Other responses in the ChangeTypeOther and/or ChangeReasonOther columns in SharePoint.  That's where the problem is occurring.  Submitting the form does not populate those columns with text entered in those Text Input fields in the form.

    Patti

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @PVLove 

    Yes, so trying to determine your need then for the Choices column to allow write-ins if you are not utilizing that feature but instead putting them into the other column.

     

    The unfortunate part about Galleries in a Form is that there is a bug with dealing with the gallery currently.  Ideally all of this should be done without any clumsy collections or actions as they all have to be dealt with in behavioral actions.

    BUT, that cannot be done at this point because of the Gallery in a Form bug.  

    It is MUCH better to put the Gallery outside of the form (it can still be on top of the form in a way that it looks completely the same as your current form).

    The form can then reference that Gallery without any issues.

     

    However, to get to the "other" text input control (I assume you have the TextInput control IN your gallery) in your gallery, you would *normally* get it with - LookUp(yourGallery.AllItems, Value="Other", yourTextInput.Text)  (which would then be the Update formula on your "other" column datacards.)

    But, it is the AllItems that breaks in a form.  Put this outside and it will work like a charm.

     

    Otherwise, you would need a way to do some behavioral action on the textinput in your gallery to capture the value entered into some variable and then use that for the Update property of the "other" column datacards in your form.

  • PVLove Profile Picture
    299 on at

    Fortunately, I'm working on a 'test' form and can move the Gallery over the form.  However, I 'pasted' the TextInput into the ChangeType datacard.  I tried pasting the ChangeTypeOther control into the ChangeType datacard, but that didn't work either.  I'll move it to he Gallery and see if I have any luck with that.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @PVLove 

    Yes, the general concept is fairly straight forward is the gallery is outside of the form.

    A question first though...you show "Other" in your gallery.  Is "Other" one of the Choices defined in the underlying column choices, or are you injecting it into your gallery?

     

  • PVLove Profile Picture
    299 on at

    'Other' is an option in the Choices column.  I have a SingleText column for the response to the 'Other' selection in the Choice column, but I'm lost on how to add it to the form and update the SharePoint list.

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @PVLove 

    Yes, I understand...this is what we are getting to and thus the questions.

     

    The general concept is this (assuming your gallery is now outside of the form):

    1) You will need to utilize a variable or reference for the Item property of the form!  If you are setting a variable to the record to edit, then this is fine.  If you are referencing a control (like a Gallery.Selected), that is fine.  If you are doing a LookUp in the Item property, then this will need to be changed.  If any question on this, please provide your Item property for the form.

    For the purpose of the rest of this instruction list, I will assume a variable and I will call it glbCurrentRecord.  Replace as appropriate.

    2) The Gallery would have the same Items property as you have before.

    3) In the Gallery, you will also have a TextInput control.  That control would have a Visible property set to:

        ThisItem.Value = "Other" && checkBoxName.Value

        It would have a Default property of: glbCurrentRecord.ChangeTypeOther

    4) For your checkbox in the gallery: 

       The Default would be:  ThisItem.Value in glbCurrentRecord.ChangeType

       The Text property would be:  ThisItem.Value

    5) In the ChangeType datacard in the form, the Update property would be:

        ForAll(Filter(yourGalleryName.AllItems, checkBoxName.Value), {Value: Value})

    6) The Update property of the ChangeTypeOther datacard would be:

        LookUp(yourGalleryName.AllItems, checkBoxName.Text = "Other" && checkBoxName.Value, TextInputControlName.Text)

     

    That is it.  It should all work then from there.  You can get rid of all the OnCheck and OnUncheck actions.  They are not needed.

  • PVLove Profile Picture
    299 on at

    Thanks!  I'm going to scrap this test form and start over in a clean app.  I have several test forms in this app and they are clashing.  I'll send you message Monday or Tuesday and let you know how far I get.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @PVLove 

    Sounds good!  Let me know how it turns out and have a great weekend!

  • PVLove Profile Picture
    299 on at

    Morning @RandyHayes !

    You are the BOMB! I followed your instructions and now have an input field for the corresponding checkbox. However, I'm not using a Gallery for my Form and cannot set a Variable on the Form's 'Item' property. PowerApps let me set a variable (varRecord) for each of the checkboxes and text input fields using 'varRecord.Value.' The variable and column name, e.g., varRecord.ChangeType, produces the following error message: Name isn't valid. This identifier isn't recognized. The varRecord.Value variable is working on the checkboxes and text input fields, but the text input fields display 'Payroll' when a checkbox is selected in the form.  UPDATE:  Opened the form Wednesday morning and 'Payroll' is no longer displayed in the text input fields.  Thanks for ALL of your help!

    Patti

    payrollChange4.png

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
WarrenBelz Profile Picture

WarrenBelz 400 Most Valuable Professional

#2
11manish Profile Picture

11manish 141 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 109 Super User 2026 Season 2

Last 30 days Overall leaderboard